summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d747d43)
One has to allocate space for the trailing NUL, too.
- char* firstword = (char*) xmalloc(strlen(reply));
+ char* firstword = (char*) xmalloc(strlen(reply)+1);
sscanf(reply, "%s", firstword);
for (int i = 0; i < (int)strlen(firstword); ++i)
sscanf(reply, "%s", firstword);
for (int i = 0; i < (int)strlen(firstword); ++i)