mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
array_grow(): fix wrong sizeof()
The array_grow() function calculates the size by multiplying with sizeof(union Value*), where sizeof(union Value) was clearly meant. In practice, these are the same size on most (or maybe even all) systems, as no current member of union Value is larger than a pointer -- see name.h. But it's still wrong.
This commit is contained in:
parent
39673b1207
commit
9e525c5bde
1 changed files with 1 additions and 1 deletions
|
@ -819,7 +819,7 @@ static struct index_array *array_grow(Namval_t *np, register struct index_array
|
|||
errormsg(SH_DICT,ERROR_exit(1),e_subscript, fmtbase((long)maxi,10,0));
|
||||
UNREACHABLE();
|
||||
}
|
||||
i = (newsize-1)*sizeof(union Value*)+newsize;
|
||||
i = (newsize-1)*sizeof(union Value)+newsize;
|
||||
ap = new_of(struct index_array,i);
|
||||
memset((void*)ap,0,sizeof(*ap)+i);
|
||||
ap->maxi = newsize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue