aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/grep
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2017-04-04 13:34:19 +0000
committerEd Maste <emaste@FreeBSD.org>2017-04-04 13:34:19 +0000
commita734ae9c14a6bb6f908fbd5877c17617c7d287ee (patch)
tree805ac47662601ad873a68b3f5c7ff8d32a9d79dd /usr.bin/grep
parent06d8e9dc9e327493a708aa5d93a14c943de45cde (diff)
downloadsrc-a734ae9c14a6bb6f908fbd5877c17617c7d287ee.tar.gz
src-a734ae9c14a6bb6f908fbd5877c17617c7d287ee.zip
bsdgrep: Initialize vars to avoid a false positive GCC warning
Reported by: lwhsu MFC after: 1 month MFC with: r316477
Notes
Notes: svn path=/head/; revision=316489
Diffstat (limited to 'usr.bin/grep')
-rw-r--r--usr.bin/grep/util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index 72603fbabb3d..c9f326c4dea3 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -282,6 +282,9 @@ procline(struct str *l, int nottext)
int c = 0, m = 0, r = 0, lastmatches = 0, leflags = eflags;
int startm = 0;
+ /* Initialize to avoid a false positive warning from GCC. */
+ lastmatch.rm_so = lastmatch.rm_eo = 0;
+
/* Loop to process the whole line */
while (st <= l->len) {
lastmatches = 0;