chiark
/
gitweb
/
~mdw
/
runlisp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib.c: Use the size of the element when allocating an array.
[runlisp]
/
lib.c
diff --git
a/lib.c
b/lib.c
index 0d618f655a4d712c419ae0f7ac6576ebf83e3dc4..251d932e5fb6dbdeccf70e792e48aeca261ce0bc 100644
(file)
--- a/
lib.c
+++ b/
lib.c
@@
-932,7
+932,7
@@
static void set_config_section_parents(struct config *conf,
* to have, so we can allocate the `parents' vector and fill it in.
*/
sect->nparents = av.n/2;
* to have, so we can allocate the `parents' vector and fill it in.
*/
sect->nparents = av.n/2;
- sect->parents = xmalloc(sect->nparents*sizeof(sect->parents));
+ sect->parents = xmalloc(sect->nparents*sizeof(
*
sect->parents));
for (i = 0; i < av.n; i += 2) {
n = av.v[i + 1] - av.v[i];
parent = config_find_section_n(conf, 0, av.v[i], n);
for (i = 0; i < av.n; i += 2) {
n = av.v[i + 1] - av.v[i];
parent = config_find_section_n(conf, 0, av.v[i], n);