Fixed uninitialized terminator

This commit is contained in:
Sean Anderson
2016-07-04 13:33:23 -04:00
parent 4080345c4d
commit 43b3fdbd8a

1
mpc.c
View File

@@ -139,6 +139,7 @@ static mpc_input_t *mpc_input_new_nstring(const char *filename, const char *stri
i->string = malloc(length + 1); i->string = malloc(length + 1);
strncpy(i->string, string, length); strncpy(i->string, string, length);
i->string[length] = '\0';
i->buffer = NULL; i->buffer = NULL;
i->file = NULL; i->file = NULL;