X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=json.c;h=817fc83a3de060eb954575138a7c2c50471982ea;hp=1d0c169449657c49970390ebf76cf98ce11be2e8;hb=eae27dd5cc2224e4367aa402bdaea38a31649d83;hpb=4a442846926f7e3d1b30b7afac59dd1def0e5a41 diff --git a/json.c b/json.c index 1d0c1694..817fc83a 100644 --- 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))); }