aboutsummaryrefslogtreecommitdiffstats
path: root/field.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-06-22 08:26:27 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-06-22 08:26:27 -0400
commit288b15d0793936fa14b51ed860056f6ce6200c52 (patch)
tree5de9e9dca8b30e8d168da8661ae88e3ffe2504a3 /field.c
parentb7d8b6ebcd5dd714bc21acf7637d9a651e2f7ea7 (diff)
downloadegawk-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 'field.c')
-rw-r--r--field.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/field.c b/field.c
index 61f0d7f6..d8c97413 100644
--- a/field.c
+++ b/field.c
@@ -274,10 +274,8 @@ set_record(const char *buf, int cnt, const awk_fieldwidth_info_t *fw)
/* buffer management: */
if (databuf_size == 0) { /* first time */
- emalloc(databuf, char *, INITIAL_SIZE, "set_record");
+ ezalloc(databuf, char *, INITIAL_SIZE, "set_record");
databuf_size = INITIAL_SIZE;
- memset(databuf, '\0', INITIAL_SIZE);
-
}
/*
* Make sure there's enough room. Since we sometimes need