diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2017-06-22 08:26:27 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2017-06-22 08:26:27 -0400 |
commit | 288b15d0793936fa14b51ed860056f6ce6200c52 (patch) | |
tree | 5de9e9dca8b30e8d168da8661ae88e3ffe2504a3 /int_array.c | |
parent | b7d8b6ebcd5dd714bc21acf7637d9a651e2f7ea7 (diff) | |
download | egawk-288b15d0793936fa14b51ed860056f6ce6200c52.tar.gz egawk-288b15d0793936fa14b51ed860056f6ce6200c52.tar.bz2 egawk-288b15d0793936fa14b51ed860056f6ce6200c52.zip |
Replace malloc+memset with calloc, mostly by using the new ezalloc macro.
Diffstat (limited to 'int_array.c')
-rw-r--r-- | int_array.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/int_array.c b/int_array.c index 992da4a6..1c309cfd 100644 --- a/int_array.c +++ b/int_array.c @@ -458,8 +458,7 @@ int_copy(NODE *symbol, NODE *newsymb) cursize = symbol->array_size; /* allocate new table */ - emalloc(new, BUCKET **, cursize * sizeof(BUCKET *), "int_copy"); - memset(new, '\0', cursize * sizeof(BUCKET *)); + ezalloc(new, BUCKET **, cursize * sizeof(BUCKET *), "int_copy"); old = symbol->buckets; @@ -842,8 +841,7 @@ grow_int_table(NODE *symbol) } /* allocate new table */ - emalloc(new, BUCKET **, newsize * sizeof(BUCKET *), "grow_int_table"); - memset(new, '\0', newsize * sizeof(BUCKET *)); + ezalloc(new, BUCKET **, newsize * sizeof(BUCKET *), "grow_int_table"); old = symbol->buckets; symbol->buckets = new; |