svn commit: r332858 - head/usr.bin/grep

Kyle Evans kevans at FreeBSD.org
Sat Apr 21 14:58:46 UTC 2018


Author: kevans
Date: Sat Apr 21 14:58:45 2018
New Revision: 332858
URL: https://svnweb.freebsd.org/changeset/base/332858

Log:
  bsdgrep: Use grep_strdup instead of grep_malloc+strcpy

Modified:
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/util.c
==============================================================================
--- head/usr.bin/grep/util.c	Sat Apr 21 14:56:41 2018	(r332857)
+++ head/usr.bin/grep/util.c	Sat Apr 21 14:58:45 2018	(r332858)
@@ -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;


More information about the svn-src-all mailing list