aboutsummaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'json.c')
-rw-r--r--json.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/json.c b/json.c
index 1d0c169..3fd923c 100644
--- a/json.c
+++ b/json.c
@@ -105,5 +105,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)));
}