projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf2fa22
)
Fix an OB1 bug in allocation.
author
Eric S. Raymond
<esr@thyrsus.com>
Thu, 29 Jun 2017 17:43:36 +0000
(13:43 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Thu, 29 Jun 2017 17:43:36 +0000
(13:43 -0400)
misc.c
patch
|
blob
|
history
diff --git
a/misc.c
b/misc.c
index 4f32246c75ff69802e23fb8d0a42888b8df89b92..46a3d6002348023ea30045a11aa494e024c5cf63 100644
(file)
--- 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