From 9ffd42317b5a53c2236268808e34c90601f286c1 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 21 May 2006 18:30:35 +0000 Subject: Minor cleanups: Convert a few calloc() calls to xzalloc, remove unnecessary memset, collate variable declarations... --- editors/sed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'editors/sed.c') diff --git a/editors/sed.c b/editors/sed.c index 8939311..39b28d0 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -449,7 +449,7 @@ static char *parse_cmd_args(sed_cmd_t *sed_cmd, char *cmdstr) parse_escapes(match,match,strlen(match),i,i); parse_escapes(replace,replace,strlen(replace),i,i); - sed_cmd->string = xcalloc(1, (strlen(match) + 1) * 2); + sed_cmd->string = xzalloc((strlen(match) + 1) * 2); for (i = 0; match[i] && replace[i]; i++) { sed_cmd->string[i * 2] = match[i]; sed_cmd->string[(i * 2) + 1] = replace[i]; @@ -513,7 +513,7 @@ static void add_cmd(char *cmdstr) * part1 part2 part3 */ - sed_cmd = xcalloc(1, sizeof(sed_cmd_t)); + sed_cmd = xzalloc(sizeof(sed_cmd_t)); /* first part (if present) is an address: either a '$', a number or a /regex/ */ cmdstr += get_address(cmdstr, &sed_cmd->beg_line, &sed_cmd->beg_match); -- cgit v1.1