mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-22 22:44:25 +01:00
Use snprintf(...) instead of sprintf(...)
This commit is contained in:
committed by
Rusty Russell
parent
0f7b11bdc2
commit
9d9a9523d0
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user