From 66ab298323e6a9acf6084303b76a4471d079f813 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sat, 21 Apr 2018 14:58:45 +0000 Subject: [PATCH] bsdgrep: Use grep_strdup instead of grep_malloc+strcpy --- usr.bin/grep/util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 07067a9d3356..bc591601af57 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -323,8 +323,7 @@ procfile(const char *fn) return (0); } - pc.ln.file = grep_malloc(strlen(fn) + 1); - strcpy(pc.ln.file, fn); + pc.ln.file = grep_strdup(fn); pc.ln.line_no = 0; pc.ln.len = 0; pc.ln.boff = 0;