diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-05-21 18:30:35 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-05-21 18:30:35 +0000 |
commit | 8f30399d9a813414e47d89bed9efbc9e84ae697d (patch) | |
tree | b126ca6ff7d2db91fa3525c6e5d3978932137fa3 /editors/sed.c | |
parent | 2cf3fce2b8fbc52ee550cebf6363a737950703a0 (diff) | |
download | busybox-w32-8f30399d9a813414e47d89bed9efbc9e84ae697d.tar.gz busybox-w32-8f30399d9a813414e47d89bed9efbc9e84ae697d.tar.bz2 busybox-w32-8f30399d9a813414e47d89bed9efbc9e84ae697d.zip |
Minor cleanups: Convert a few calloc() calls to xzalloc, remove unnecessary
memset, collate variable declarations...
git-svn-id: svn://busybox.net/trunk/busybox@15156 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'editors/sed.c')
-rw-r--r-- | editors/sed.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/sed.c b/editors/sed.c index 893931153..39b28d006 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) | |||
449 | parse_escapes(match,match,strlen(match),i,i); | 449 | parse_escapes(match,match,strlen(match),i,i); |
450 | parse_escapes(replace,replace,strlen(replace),i,i); | 450 | parse_escapes(replace,replace,strlen(replace),i,i); |
451 | 451 | ||
452 | sed_cmd->string = xcalloc(1, (strlen(match) + 1) * 2); | 452 | sed_cmd->string = xzalloc((strlen(match) + 1) * 2); |
453 | for (i = 0; match[i] && replace[i]; i++) { | 453 | for (i = 0; match[i] && replace[i]; i++) { |
454 | sed_cmd->string[i * 2] = match[i]; | 454 | sed_cmd->string[i * 2] = match[i]; |
455 | sed_cmd->string[(i * 2) + 1] = replace[i]; | 455 | sed_cmd->string[(i * 2) + 1] = replace[i]; |
@@ -513,7 +513,7 @@ static void add_cmd(char *cmdstr) | |||
513 | * part1 part2 part3 | 513 | * part1 part2 part3 |
514 | */ | 514 | */ |
515 | 515 | ||
516 | sed_cmd = xcalloc(1, sizeof(sed_cmd_t)); | 516 | sed_cmd = xzalloc(sizeof(sed_cmd_t)); |
517 | 517 | ||
518 | /* first part (if present) is an address: either a '$', a number or a /regex/ */ | 518 | /* first part (if present) is an address: either a '$', a number or a /regex/ */ |
519 | cmdstr += get_address(cmdstr, &sed_cmd->beg_line, &sed_cmd->beg_match); | 519 | cmdstr += get_address(cmdstr, &sed_cmd->beg_line, &sed_cmd->beg_match); |