Fixed uninitialized terminator
This commit is contained in:
1
mpc.c
1
mpc.c
@@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user