summaryrefslogtreecommitdiff
path: root/src/kwset.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-07-14 19:38:01 +0200
committerPaul Eggert <eggert@cs.ucla.edu>2016-07-14 19:49:40 +0200
commit65fa1e31c0da8dc26f872c050e81b649dc65a32b (patch)
tree8b346dc85a8327d2c93c42404562c92480fd9add /src/kwset.c
parentcf39d76da476b747b1b875bdd92dd00770ae4936 (diff)
downloadgrep-65fa1e31c0da8dc26f872c050e81b649dc65a32b.tar.gz
grep: minor style changes for -F crash fix
* src/kwset.c (memoff2_kwset): Use ?: instead of if-else.
Diffstat (limited to 'src/kwset.c')
-rw-r--r--src/kwset.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/kwset.c b/src/kwset.c
index 80df752d..264ef22e 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -643,13 +643,9 @@ memoff2_kwset (char const *s, size_t n, kwset_t kwset,
{
struct tree const *link = kwset->trie->links;
struct tree const *clink = link->llink ? link->llink : link->rlink;
- char const *mch;
-
- if (clink)
- mch = memchr2 (s, link->label, clink->label, n);
- else
- mch = memchr (s, link->label, n);
-
+ char const *mch = (clink
+ ? memchr2 (s, link->label, clink->label, n)
+ : memchr (s, link->label, n));
if (! mch)
return SIZE_MAX;
else