home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddf0e5d
)
Forgot to allocate one byte for string-terminating null byte.
author
Christian Heller
<c.heller@plomlompom.de>
Wed, 1 May 2013 02:52:32 +0000
(
04:52
+0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Wed, 1 May 2013 02:52:32 +0000
(
04:52
+0200)
roguelike.c
patch
|
blob
|
history
diff --git
a/roguelike.c
b/roguelike.c
index ee5dbe48be76fa54e3e9f7cafd2993a0c13404d6..34f3c855da6c9d2927bfad84e73ff11fe207f4e7 100644
(file)
--- a/
roguelike.c
+++ b/
roguelike.c
@@
-262,7
+262,7
@@
void init_keybindings(struct World * world) {
c = getc(file);
while (EOF != c) {
if ('\n' == c) {
- keybindings[keycount].name = calloc(commcount, sizeof(char));
+ keybindings[keycount].name = calloc(commcount
+ 1
, sizeof(char));
memcpy(keybindings[keycount].name, command, commcount);
keybindings[keycount].key = key;
keycount++;