douniwan5788:

This commit is contained in:
roel@libnfc.org 2013-02-28 16:04:21 +00:00
commit 50d6e4abc1

View file

@ -144,7 +144,7 @@ static void *main_loop(void *targ) {
nl = strrchr(script_cmd_buf, '\n'); nl = strrchr(script_cmd_buf, '\n');
if (nl) *nl = '\0'; if (nl) *nl = '\0';
if ((cmd = (char*) malloc(strlen(script_cmd_buf))) != NULL) if ((cmd = (char*) malloc(strlen(script_cmd_buf) + 1)) != NULL)
{ {
memset(cmd, 0, strlen(script_cmd_buf)); memset(cmd, 0, strlen(script_cmd_buf));
strcpy(cmd, script_cmd_buf); strcpy(cmd, script_cmd_buf);