X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=misc.c;h=e69fc9bdf495fe2c63b52e2d3e273509db3b5d54;hp=4f32246c75ff69802e23fb8d0a42888b8df89b92;hb=aa1dd666a9e5a972cb8e29c70cebb9c35a785ddf;hpb=bf2fa227f0786952ae4a632a1520bf1cf6663c98 diff --git a/misc.c b/misc.c index 4f32246..e69fc9b 100644 --- a/misc.c +++ b/misc.c @@ -106,8 +106,8 @@ void tokenize(char* raw, long tokens[4]) // grab the first two words char* words[2]; - words[0] = (char*) xmalloc(strlen(raw)); - words[1] = (char*) xmalloc(strlen(raw)); + words[0] = (char*) xmalloc(strlen(raw) + 1); + words[1] = (char*) xmalloc(strlen(raw) + 1); int word_count = sscanf(raw, "%s%s", words[0], words[1]); // make space for substrings and zero it out @@ -152,7 +152,7 @@ void wordclear(token_t *v) *v = 0; } -/* I/O routines (speak, pspeak, rspeak, GETIN, YES) */ +/* I/O routines (speak, pspeak, rspeak, get_input, yes) */ void vspeak(const char* msg, va_list ap) {