Fix an OB1 bug in allocation.

This commit is contained in:
Eric S. Raymond 2017-06-29 13:43:36 -04:00
parent bf2fa227f0
commit 58a8a761e2

4
misc.c
View file

@ -106,8 +106,8 @@ void tokenize(char* raw, long tokens[4])
// grab the first two words // grab the first two words
char* words[2]; char* words[2];
words[0] = (char*) xmalloc(strlen(raw)); words[0] = (char*) xmalloc(strlen(raw)+1);
words[1] = (char*) xmalloc(strlen(raw)); words[1] = (char*) xmalloc(strlen(raw)+1);
int word_count = sscanf(raw, "%s%s", words[0], words[1]); int word_count = sscanf(raw, "%s%s", words[0], words[1]);
// make space for substrings and zero it out // make space for substrings and zero it out