inpcom.c, inp_remove_ws(), avoid appending a surplus '\0'
This commit is contained in:
parent
07ba16192e
commit
82a5c1c48a
|
|
@ -2199,7 +2199,7 @@ static char*
|
||||||
inp_remove_ws(char *s)
|
inp_remove_ws(char *s)
|
||||||
{
|
{
|
||||||
char *x = s;
|
char *x = s;
|
||||||
char *big_buff = TMALLOC(char, strlen(s) + 2);
|
char *big_buff = TMALLOC(char, strlen(s) + 1);
|
||||||
char *d = big_buff;
|
char *d = big_buff;
|
||||||
char *buffer;
|
char *buffer;
|
||||||
bool is_expression = FALSE;
|
bool is_expression = FALSE;
|
||||||
|
|
@ -2214,6 +2214,9 @@ inp_remove_ws(char *s)
|
||||||
if (*s == '=' || (is_expression && (is_arith_char(*s) || *s == ','))) {
|
if (*s == '=' || (is_expression && (is_arith_char(*s) || *s == ','))) {
|
||||||
s = skip_ws(s + 1);
|
s = skip_ws(s + 1);
|
||||||
|
|
||||||
|
if (*s == '\0')
|
||||||
|
continue;
|
||||||
|
|
||||||
if (*s == '{')
|
if (*s == '{')
|
||||||
is_expression = TRUE;
|
is_expression = TRUE;
|
||||||
if (*s == '}')
|
if (*s == '}')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue