[hackers] [sbase] sed: use reallocarray (non-issue) || Hiltjo Posthuma
commit e2edbdcb87c89d69ab8cbf1a753ead75ccea5949
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Fri Apr 17 18:48:11 2015 +0200
sed: use reallocarray (non-issue)
diff --git a/sed.c b/sed.c
index 6b10eb6..6982c40 100644
--- a/sed.c
+++ b/sed.c
_AT_@ -1428,7 +1428,7 @@ cmd_s(Cmd *c)
lastre = re;
plen = re->re_nsub + 1;
- pmatch = emalloc(plen * sizeof(regmatch_t));
+ pmatch = ereallocarray(NULL, plen, sizeof(regmatch_t));
*genbuf.str = '\0';
s = patt.str;
Received on Fri Apr 17 2015 - 20:01:08 CEST
This archive was generated by hypermail 2.3.0
: Fri Apr 17 2015 - 20:12:11 CEST