diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2014-04-22 08:26:32 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2014-04-22 08:26:32 +0000 |
commit | ad7156d35e09c6c4acaad6f32dba7f4573078765 (patch) | |
tree | ae15d63a1ea8a1c5fb567ba20f773306d6ffcf2f /usr.bin/make | |
parent | 5059d0414ab5c579f4735bb139f96ec87e43f3ca (diff) |
effectively use emult_realloc, okay guenther@
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/garray.h | 6 | ||||
-rw-r--r-- | usr.bin/make/str.c | 6 | ||||
-rw-r--r-- | usr.bin/make/varmodifiers.c | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/make/garray.h b/usr.bin/make/garray.h index 01ba165d76b..c8d67082266 100644 --- a/usr.bin/make/garray.h +++ b/usr.bin/make/garray.h @@ -1,7 +1,7 @@ #ifndef GARRAY_H #define GARRAY_H -/* $OpenBSD: garray.h,v 1.6 2010/07/19 19:46:44 espie Exp $ */ +/* $OpenBSD: garray.h,v 1.7 2014/04/22 08:26:31 espie Exp $ */ /* Growable array implementation */ /* @@ -52,8 +52,8 @@ do { \ do { \ if ((l)->n >= (l)->size) { \ (l)->size *= 2; \ - (l)->a = erealloc((l)->a, \ - sizeof(struct GNode *) * (l)->size);\ + (l)->a = emult_realloc((l)->a, \ + (l)->size, sizeof(struct GNode *)); \ MAY_INCREASE_STATS; \ } \ (l)->a[(l)->n++] = (gn); \ diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index 8aee1e375f2..755d65f2a25 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -1,4 +1,4 @@ -/* $OpenBSD: str.c,v 1.28 2013/11/22 15:47:35 espie Exp $ */ +/* $OpenBSD: str.c,v 1.29 2014/04/22 08:26:31 espie Exp $ */ /* $NetBSD: str.c,v 1.13 1996/11/06 17:59:23 christos Exp $ */ /*- @@ -150,8 +150,8 @@ brk_string(const char *str, int *store_argc, char **buffer) *t++ = '\0'; if (argc == argmax) { argmax *= 2; /* ramp up fast */ - argv = erealloc(argv, - (argmax + 1) * sizeof(char *)); + argv = emult_realloc(argv, + (argmax + 1), sizeof(char *)); } argv[argc++] = start; start = NULL; diff --git a/usr.bin/make/varmodifiers.c b/usr.bin/make/varmodifiers.c index abb73092711..149d5c3959f 100644 --- a/usr.bin/make/varmodifiers.c +++ b/usr.bin/make/varmodifiers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: varmodifiers.c,v 1.35 2013/11/22 15:47:35 espie Exp $ */ +/* $OpenBSD: varmodifiers.c,v 1.36 2014/04/22 08:26:31 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -460,14 +460,14 @@ do_sort(const char *s, const struct Name *dummy UNUSED, void *arg UNUSED) const char *start, *end; n = 1024; /* start at 1024 words */ - t = (struct Name *)emalloc(sizeof(struct Name) * n); + t = ecalloc(n, sizeof(struct Name)); start = s; end = start; for (i = 0;; i++) { if (i == n) { n *= 2; - t = (struct Name *)erealloc(t, sizeof(struct Name) * n); + t = emult_realloc(t, n, sizeof(struct Name)); } start = iterate_words(&end); if (start == NULL) |