aboutsummaryrefslogtreecommitdiff
path: root/editors/awk.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/awk.c')
-rw-r--r--editors/awk.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/editors/awk.c b/editors/awk.c
index f4eb1ab90..74f9d8e54 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -474,9 +474,9 @@ static xhash *hash_init(void)
474{ 474{
475 xhash *newhash; 475 xhash *newhash;
476 476
477 newhash = (xhash *)xcalloc(1, sizeof(xhash)); 477 newhash = (xhash *)xzalloc(sizeof(xhash));
478 newhash->csize = FIRST_PRIME; 478 newhash->csize = FIRST_PRIME;
479 newhash->items = (hash_item **)xcalloc(newhash->csize, sizeof(hash_item *)); 479 newhash->items = (hash_item **)xzalloc(newhash->csize * sizeof(hash_item *));
480 480
481 return newhash; 481 return newhash;
482} 482}
@@ -505,7 +505,7 @@ static void hash_rebuild(xhash *hash)
505 return; 505 return;
506 506
507 newsize = PRIMES[hash->nprime++]; 507 newsize = PRIMES[hash->nprime++];
508 newitems = (hash_item **)xcalloc(newsize, sizeof(hash_item *)); 508 newitems = (hash_item **)xzalloc(newsize * sizeof(hash_item *));
509 509
510 for (i=0; i<hash->csize; i++) { 510 for (i=0; i<hash->csize; i++) {
511 hi = hash->items[i]; 511 hi = hash->items[i];
@@ -536,7 +536,7 @@ static void *hash_find(xhash *hash, const char *name)
536 hash_rebuild(hash); 536 hash_rebuild(hash);
537 537
538 l = strlen(name) + 1; 538 l = strlen(name) + 1;
539 hi = xcalloc(sizeof(hash_item) + l, 1); 539 hi = xzalloc(sizeof(hash_item) + l);
540 memcpy(hi->name, name, l); 540 memcpy(hi->name, name, l);
541 541
542 idx = hashidx(name) % hash->csize; 542 idx = hashidx(name) % hash->csize;
@@ -993,7 +993,7 @@ static node *new_node(uint32_t info)
993{ 993{
994 register node *n; 994 register node *n;
995 995
996 n = (node *)xcalloc(sizeof(node), 1); 996 n = (node *)xzalloc(sizeof(node));
997 n->info = info; 997 n->info = info;
998 n->lineno = lineno; 998 n->lineno = lineno;
999 return n; 999 return n;
@@ -1095,7 +1095,7 @@ static node *parse_expr(uint32_t iexp)
1095 case TC_NUMBER: 1095 case TC_NUMBER:
1096 case TC_STRING: 1096 case TC_STRING:
1097 cn->info = OC_VAR; 1097 cn->info = OC_VAR;
1098 v = cn->l.v = xcalloc(sizeof(var), 1); 1098 v = cn->l.v = xzalloc(sizeof(var));
1099 if (tc & TC_NUMBER) 1099 if (tc & TC_NUMBER)
1100 setvar_i(v, t.number); 1100 setvar_i(v, t.number);
1101 else 1101 else
@@ -1104,7 +1104,7 @@ static node *parse_expr(uint32_t iexp)
1104 1104
1105 case TC_REGEXP: 1105 case TC_REGEXP:
1106 mk_re_node(t.string, cn, 1106 mk_re_node(t.string, cn,
1107 (regex_t *)xcalloc(sizeof(regex_t),2)); 1107 (regex_t *)xzalloc(sizeof(regex_t)*2));
1108 break; 1108 break;
1109 1109
1110 case TC_FUNCTION: 1110 case TC_FUNCTION:
@@ -1590,7 +1590,7 @@ static void hashwalk_init(var *v, xhash *array)
1590 free(v->x.walker); 1590 free(v->x.walker);
1591 1591
1592 v->type |= VF_WALK; 1592 v->type |= VF_WALK;
1593 w = v->x.walker = (char **)xcalloc(2 + 2*sizeof(char *) + array->glen, 1); 1593 w = v->x.walker = (char **)xzalloc(2 + 2*sizeof(char *) + array->glen);
1594 *w = *(w+1) = (char *)(w + 2); 1594 *w = *(w+1) = (char *)(w + 2);
1595 for (i=0; i<array->csize; i++) { 1595 for (i=0; i<array->csize; i++) {
1596 hi = array->items[i]; 1596 hi = array->items[i];