summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevans <kevans@FreeBSD.org>2017-08-17 17:13:15 +0000
committerkevans <kevans@FreeBSD.org>2017-08-17 17:13:15 +0000
commite986b18c867bd283af7811e671c4abb150aac98a (patch)
tree9999b80ced675f30df6e4f8a65633a46741b0c4b
parent8a00dc568742c6a3e32ef33b446a660cefa790f1 (diff)
downloadFreeBSD-src-e986b18c867bd283af7811e671c4abb150aac98a.zip
FreeBSD-src-e986b18c867bd283af7811e671c4abb150aac98a.tar.gz
MFC r318916: bsdgrep: use safer sizeof() construct
Approved by: emaste (mentor, blanket MFC)
-rw-r--r--usr.bin/grep/regex/tre-fastmatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c
index bf59b9f..6bf7c44 100644
--- a/usr.bin/grep/regex/tre-fastmatch.c
+++ b/usr.bin/grep/regex/tre-fastmatch.c
@@ -351,7 +351,7 @@ static int fastcmp(const fastmatch_t *fg, const void *data,
#define FILL_BMGS \
if (fg->len > 0 && !fg->hasdot) \
{ \
- fg->sbmGs = malloc(fg->len * sizeof(int)); \
+ fg->sbmGs = malloc(fg->len * sizeof(*fg->sbmGs)); \
if (!fg->sbmGs) \
return REG_ESPACE; \
if (fg->len == 1) \
@@ -367,7 +367,7 @@ static int fastcmp(const fastmatch_t *fg, const void *data,
#define FILL_BMGS_WIDE \
if (fg->wlen > 0 && !fg->hasdot) \
{ \
- fg->bmGs = malloc(fg->wlen * sizeof(int)); \
+ fg->bmGs = malloc(fg->wlen * sizeof(*fg->bmGs)); \
if (!fg->bmGs) \
return REG_ESPACE; \
if (fg->wlen == 1) \
OpenPOWER on IntegriCloud