int level, int flags)
{
#define jso ((struct json_object_base *)jso)
- printbuf_strappend(pb, "\"");
ssize_t len = JC_STRING(jso)->len;
- json_escape_str(pb, get_string_component(jso), len < 0 ? -len : len, flags);
+ printbuf_strappend(pb, "\"");
+ json_escape_str(pb, get_string_component(jso), len < 0 ? -(ssize_t)len : len, flags);
printbuf_strappend(pb, "\"");
return 0;
#undef jso
{
case json_type_string:
len = JC_STRING_C(jso)->len;
- return (len < 0) ? -len : len;
+ return (len < 0) ? -(ssize_t)len : len;
default: return 0;
}
#undef jso
if (JC_STRING(jso)->len < 0)
free(JC_STRING(jso)->c_string.pdata);
JC_STRING(jso)->c_string.pdata = dstbuf;
- newlen = -len;
+ newlen = -(ssize_t)len;
}
else if (JC_STRING(jso)->len < 0)
{
// We've got enough room in the separate allocated buffer,
// so use it as-is and continue to indicate that pdata is used.
- newlen = -len;
+ newlen = -(ssize_t)len;
}
memcpy(dstbuf, (const void *)s, len);