Avoid out-of-spec strncat usage.
mes.c (readword): Use character assignment instead of strncat. Fixes Valgrind nit.
This commit is contained in:
parent
513bd09f76
commit
c5e3e3818d
5
mes.c
5
mes.c
|
@ -1102,7 +1102,10 @@ readword (int c, char *w, scm *a)
|
|||
if (c == '#' && peek_char () == '!') {getchar (); readblock (getchar ()); return readword (getchar (), w, a);}
|
||||
char buf[256] = {0};
|
||||
char ch = c;
|
||||
return readword (getchar (), strncat (w ? w : buf, &ch, 1), a);
|
||||
char *p = w ? w + strlen (w) : buf;
|
||||
*p = ch;
|
||||
*(p+1) = 0;
|
||||
return readword (getchar (), w ? w : buf, a);
|
||||
}
|
||||
|
||||
scm *
|
||||
|
|
Loading…
Reference in a new issue