]> git.notmuchmail.org Git - notmuch/blobdiff - json.c
test: remove useless test_emacs call from an emacs FCC test
[notmuch] / json.c
diff --git a/json.c b/json.c
index 1d0c169449657c49970390ebf76cf98ce11be2e8..817fc83a3de060eb954575138a7c2c50471982ea 100644 (file)
--- a/json.c
+++ b/json.c
@@ -57,9 +57,6 @@ json_quote_chararray(const void *ctx, const char *str, const size_t len)
     size_t loop;
     size_t required;
 
-    if (len == 0)
-       return (char *)"\"\"";
-
     for (loop = 0, required = 0, ptr = str;
         loop < len;
         loop++, required++, ptr++) {
@@ -105,5 +102,8 @@ json_quote_chararray(const void *ctx, const char *str, const size_t len)
 char *
 json_quote_str(const void *ctx, const char *str)
 {
+    if (str == NULL)
+       str = "";
+
     return (json_quote_chararray (ctx, str, strlen (str)));
 }