summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2017-02-15 08:50:03 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2017-02-15 08:50:03 +0100
commitf2d2f9374bf115ad60873e6efaf2f802088bd0cd (patch)
tree8a353a2cafa4566ded79f2e0c41adb079b6e97d0 /sys/src
parent60cbbb123b106f7f31495514326a2b0bbcb0d75d (diff)
jukefs: fix realloc sizes (thanks mischief)
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/games/music/jukefs/parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/games/music/jukefs/parse.c b/sys/src/games/music/jukefs/parse.c
index 5367c7d7f..87ad7a330 100644
--- a/sys/src/games/music/jukefs/parse.c
+++ b/sys/src/games/music/jukefs/parse.c
@@ -436,7 +436,7 @@ addchild(Object *parent, Object *child, char *where)
*/
for(i = 0; i < parent->nchildren; i++)
if(parent->children[i] == child) return;
- parent->children = realloc(parent->children, (i+1)*4);
+ parent->children = realloc(parent->children, (i+1)*sizeof(Object*));
parent->children[i] = child;
parent->nchildren++;
if(parent->type == Category && child->type == Category)
@@ -457,7 +457,7 @@ addchild(Object *parent, Object *child, char *where)
i = child->ncatparents;
if(0) fprint(2, "addcatparent %s parent %d type %d child %d type %d\n",where,
parent->tabno, parent->type, child->tabno, child->type);
- child->catparents = realloc(child->catparents, (i+1)*4);
+ child->catparents = realloc(child->catparents, (i+1)*sizeof(Object*));
child->catparents[i] = parent;
child->ncatparents++;
}
@@ -476,7 +476,7 @@ addcatparent(Object *parent, Object *child)
// if(child->catparents[i] == parent) return;
i = child->ncatparents;
fprint(2, "addcatparent parent %d child %d\n", parent->tabno, child->tabno);
- child->catparents = realloc(child->catparents, (i+1)*4);
+ child->catparents = realloc(child->catparents, (i+1)*sizeof(Object*));
child->catparents[i] = parent;
child->ncatparents++;
}