Fixed null termination bug in error printing

This commit is contained in:
Daniel Holden
2015-02-08 10:45:14 +00:00
parent c4c963f3b3
commit d6347af7b4

3
mpc.c
View File

@@ -122,13 +122,14 @@ void mpc_err_string_cat(char *buffer, int *pos, int *max, char const *fmt, ...)
va_end(va);
}
static char char_unescape_buffer[3];
static char char_unescape_buffer[4];
static const char *mpc_err_char_unescape(char c) {
char_unescape_buffer[0] = '\'';
char_unescape_buffer[1] = ' ';
char_unescape_buffer[2] = '\'';
char_unescape_buffer[3] = '\0';
switch (c) {