Use snprintf(...) instead of sprintf(...)

This commit is contained in:
practicalswift
2018-07-31 14:56:04 +02:00
committed by Rusty Russell
parent 0f7b11bdc2
commit 9d9a9523d0
7 changed files with 12 additions and 12 deletions

View File

@@ -89,7 +89,7 @@ static struct json_escaped *escape(const tal_t *ctx,
break;
default:
if ((unsigned)str[i] < ' ' || str[i] == 127) {
sprintf(esc->s + n, "\\u%04X", str[i]);
snprintf(esc->s + n, 7, "\\u%04X", str[i]);
n += 5;
continue;
}