[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
libstore/kids.c question
From: |
Moritz Schulte |
Subject: |
libstore/kids.c question |
Date: |
Sun, 03 Nov 2002 19:08:50 +0100 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) |
Hi,
libstore/kids.c contains the following code:
/* Set STORE's current children list to (a copy of) CHILDREN and
NUM_CHILDREN. */
error_t
store_set_children (struct store *store,
struct store *const *children, size_t num_children)
{
unsigned size = num_children * sizeof (struct store_run);
struct store **copy = malloc (size);
if (!copy)
return ENOMEM;
if (store->children)
free (store->children);
bcopy (children, copy, size);
store->children = copy;
store->num_children = num_children;
return 0;
}
But shouldn't the first line in the function body read:
unsigned size = num_children * sizeof (struct store *);
"children" is a "struct store **".
moritz
--
moritz@duesseldorf.ccc.de - http://duesseldorf.ccc.de/~moritz/
GPG fingerprint = 3A14 3923 15BE FD57 FC06 B501 0841 2D7B 6F98 4199
- libstore/kids.c question,
Moritz Schulte <=