summaryrefslogtreecommitdiff
path: root/usr.bin/sed
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-12-01 06:37:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-12-01 06:37:26 +0000
commit1c534560fef57d760fbb3e25e0575abbeeca663a (patch)
treec2f6c1777b33203d9e2b2b661cdb35ca328ce7b2 /usr.bin/sed
parent6891c5cd8be7a81a5c46de109e4f35f246b9c6fc (diff)
sed has a xreallocarray(), but two n*s cases were not replaced
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/process.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index dfe2a9e6e51..c5e21705230 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.c,v 1.19 2013/11/28 18:24:55 deraadt Exp $ */
+/* $OpenBSD: process.c,v 1.20 2014/12/01 06:37:25 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -102,9 +102,9 @@ redirect:
goto redirect;
case 'a':
if (appendx >= appendnum) {
- appends = xrealloc(appends,
- sizeof(struct s_appends) *
- (appendnum * 2));
+ appends = xreallocarray(appends,
+ appendnum *= 2,
+ sizeof(struct s_appends));
appendnum *= 2;
}
appends[appendx].type = AP_STRING;
@@ -196,9 +196,9 @@ redirect:
exit(0);
case 'r':
if (appendx >= appendnum)
- appends = xrealloc(appends,
- sizeof(struct s_appends) *
- (appendnum *= 2));
+ appends = xreallocarray(appends,
+ appendnum *= 2,
+ sizeof(struct s_appends));
appends[appendx].type = AP_FILE;
appends[appendx].s = cp->t;
appends[appendx].len = strlen(cp->t);