[PATCH 5/5] cli/dump: replace use of gzprintf with gzputs for config values

Subject: [PATCH 5/5] cli/dump: replace use of gzprintf with gzputs for config values

Date: Sun, 12 Apr 2020 23:10:16 -0300

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: David Bremner


These can be large, and hit buffer limitations of gzprintf.
---
 notmuch-dump.c            | 4 +++-
 test/T240-dump-restore.sh | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/notmuch-dump.c b/notmuch-dump.c
index fb322237..23d7d20a 100644
--- a/notmuch-dump.c
+++ b/notmuch-dump.c
@@ -51,7 +51,9 @@ database_dump_config (notmuch_database_t *notmuch, gzFile output)
 	    goto DONE;
 	}
 
-	GZPRINTF (output, " %s\n", buffer);
+	GZPUTS (output, " ");
+	GZPUTS (output, buffer);
+	GZPUTS (output, "\n");
     }
 
     ret = EXIT_SUCCESS;
diff --git a/test/T240-dump-restore.sh b/test/T240-dump-restore.sh
index 374db5c2..3b6ab8fd 100755
--- a/test/T240-dump-restore.sh
+++ b/test/T240-dump-restore.sh
@@ -323,7 +323,6 @@ EOF
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest 'dumping large queries'
-test_subtest_known_broken
 # This value repeat was found experimentally by binary search. The
 # config value after URL encoding is exactly 4096 bytes, which
 # suggests a buffer size bug.
-- 
2.25.1

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: