projects
/
mes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
513bd09
)
Avoid out-of-spec strncat usage.
author
Jan Nieuwenhuizen
<janneke@gnu.org>
Tue, 11 Oct 2016 16:50:14 +0000
(18:50 +0200)
committer
Jan Nieuwenhuizen
<janneke@gnu.org>
Tue, 11 Oct 2016 16:50:14 +0000
(18:50 +0200)
mes.c (readword): Use character assignment instead of strncat. Fixes
Valgrind nit.
mes.c
patch
|
blob
|
history
diff --git
a/mes.c
b/mes.c
index 2e49756c672e4dd2871248cc32743db35804fc15..e6f0a02adf0c42b4ec08635eccbb01f5a661b2a9 100644
(file)
--- a/
mes.c
+++ b/
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 *