size_t loop;
size_t required;
- if (len == 0)
- return (char *)"\"\"";
-
for (loop = 0, required = 0, ptr = str;
loop < len;
loop++, required++, ptr++) {
char *
json_quote_str(const void *ctx, const char *str)
{
+ if (str == NULL)
+ str = "";
+
return (json_quote_chararray (ctx, str, strlen (str)));
}