summaryrefslogtreecommitdiff
path: root/xs_json.h
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-19 22:53:07 +0200
committerdefault <nobody@localhost>2023-04-19 22:53:07 +0200
commitd55db283902ba81c91ae7842c53d81bd0d7dd6f6 (patch)
tree19e2dbb8263b7c06066b3c43e2c20cf01f09aca6 /xs_json.h
parent3ccf4e3759684e9809ad80c2f2639ec5f069beff (diff)
Backport from xs.
Diffstat (limited to 'xs_json.h')
-rw-r--r--xs_json.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xs_json.h b/xs_json.h
index c171172..6af47a2 100644
--- a/xs_json.h
+++ b/xs_json.h
@@ -40,7 +40,7 @@ static xs_str *_xs_json_dumps_str(xs_str *s, const char *data)
if (c < 32) {
char tmp[10];
- sprintf(tmp, "\\u%04x", (unsigned int) c);
+ snprintf(tmp, sizeof(tmp), "\\u%04x", (unsigned int) c);
s = xs_str_cat(s, tmp);
}
else