summaryrefslogtreecommitdiff
path: root/libstore/kids.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2002-11-03 19:27:36 +0000
committerNeal H. Walfield <neal@gnu.org>2002-11-03 19:27:36 +0000
commitd75b31ece55771c9462336a0a31ae22c68d038c6 (patch)
tree833a487d70a66efe42302be5e0c17b2f8ef01004 /libstore/kids.c
parent643ddb349f182b4c402f0fc0e88704a8c1a224ea (diff)
2002-11-03 Neal H. Walfield <neal@cs.uml.edu>
* kids.c: Do not include <malloc.h>. Include <stdlib.h>. (store_set_children): Use memcpy, not bcopy. Calculate SIZE correctly: STORE->children is a struct store **, not a struct store_run *. Reported by Moritz Schulte <moritz@duesseldorf.ccc.de>.
Diffstat (limited to 'libstore/kids.c')
-rw-r--r--libstore/kids.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libstore/kids.c b/libstore/kids.c
index 2bacfc4d..f254bcd3 100644
--- a/libstore/kids.c
+++ b/libstore/kids.c
@@ -19,7 +19,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
@@ -31,7 +31,7 @@ error_t
store_set_children (struct store *store,
struct store *const *children, size_t num_children)
{
- unsigned size = num_children * sizeof (struct store_run);
+ unsigned size = num_children * sizeof (struct store *);
struct store **copy = malloc (size);
if (!copy)
@@ -40,7 +40,7 @@ store_set_children (struct store *store,
if (store->children)
free (store->children);
- bcopy (children, copy, size);
+ memcpy (copy, children, size);
store->children = copy;
store->num_children = num_children;