diff --git a/src/api/variables.c b/src/api/variables.c index 9ef57436b2..7a9ee74f56 100644 --- a/src/api/variables.c +++ b/src/api/variables.c @@ -175,7 +175,7 @@ int escape_json_string(char *dest, int dl, char *src, int sl) { unsigned char c = (unsigned char)src[i]; if (c >= 32) dest[j++] = src[i]; - else + else if (c > 0) strlcatf(dest, sl, j, "%%x%02X", c); } dest[j++] = '"';