]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch.c
notmuch dump: Fix buffer overrun in error message.
[notmuch] / notmuch.c
index 43af75d2450215c3a67019c425e266cb9b00b2f6..e157f02f468583f86149032fd18b26f3f0202429 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -99,7 +99,7 @@ add_files_print_progress (add_files_state_t *state)
            state->count, state->total_messages);
     print_formatted_seconds ((state->total_messages - state->count) /
                             rate_overall);
-    printf (" remaining).\r");
+    printf (" remaining).      \r");
 
     fflush (stdout);
 }
@@ -384,7 +384,7 @@ dump_command (int argc, char *argv[])
        output = fopen (argv[0], "w");
        if (output == NULL) {
            fprintf (stderr, "Error opening %s for writing: %s\n",
-                    argv[1], strerror (errno));
+                    argv[0], strerror (errno));
            ret = 1;
            goto DONE;
        }
@@ -398,7 +398,7 @@ dump_command (int argc, char *argv[])
        goto DONE;
     }
 
-    query = notmuch_query_create (notmuch, NOTMUCH_QUERY_ALL);
+    query = notmuch_query_create (notmuch, "");
     if (query == NULL) {
        fprintf (stderr, "Out of memory\n");
        ret = 1;