Replace strncat with single snprintf call

This commit is contained in:
Ace Pace 2018-11-30 21:57:20 +02:00
parent 8496944409
commit d92db8effd
1 changed files with 14 additions and 16 deletions

View File

@ -101,9 +101,7 @@ int samba_init_module(void)
}
// Build commandline
strncat(commandline, RUN_MONKEY_CMD, sizeof(RUN_MONKEY_CMD) - 1);
strncat(commandline, MONKEY_DEST_NAME, sizeof(MONKEY_DEST_NAME) - 1);
strncat(commandline, " ", 1);
snprintf(commandline, sizeof(commandline), "%s%s ", RUN_MONKEY_CMD, MONKEY_DEST_NAME);
fread(commandline + strlen(commandline), 1, LINE_MAX_LENGTH, pFile);
fclose(pFile);