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

@@ -232,7 +232,7 @@ int main(int argc, char *argv[])
* not need to have lightningd running in this case. */
if (streq(method, "help") && format == HUMAN && argc >= 3) {
char command[strlen(argv[2]) + sizeof("lightning-")];
sprintf(command, "lightning-%s", argv[2]);
snprintf(command, sizeof(command), "lightning-%s", argv[2]);
exec_man(command);
}