]> git.cworth.org Git - obsolete/notmuch-old/blobdiff - contrib/notmuch-deliver/src/main.c
notmuch-deliver: Won't deliver to more than one folder.
[obsolete/notmuch-old] / contrib / notmuch-deliver / src / main.c
index 7c314911e7afa574f4c1b64b19cc910ea2eea0b9..86437763e9431c02d683c3a24aa429135eed0cd5 100644 (file)
@@ -194,7 +194,7 @@ static int
 save_readwrite(int fdin, int fdout)
 {
        int ret, written;
-       char buf[4096], p;
+       char buf[4096], *p;
 
        for (;;) {
                ret = read(fdin, buf, 4096);
@@ -415,6 +415,11 @@ main(int argc, char **argv)
        }
        g_free(conf_path);
 
+       if ((argc - 1) > 1) {
+               g_critical("Won't deliver to %d folders", argc - 1);
+               return EX_USAGE;
+       }
+
        if (argc > 1) {
                folder = g_strdup_printf("%s%s", opt_folder ? "." : "", argv[1]);
                maildir = g_build_filename(db_path, folder, NULL);