diff options
author | Toomas Soome <tsoome@me.com> | 2022-10-04 14:53:55 +0300 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2022-10-24 20:23:37 +0300 |
commit | 00ae59338e3e57fe8bfe8118360a47a69bfd8b98 (patch) | |
tree | 7af6cffaec3a4ec189509065895d615b35e7e6bc /usr/src/lib/libc/port/gen/regexpr.c | |
parent | 1a613b61205f4ee9a9fb00184dbe6cae17a6ede7 (diff) | |
download | illumos-gate-00ae59338e3e57fe8bfe8118360a47a69bfd8b98.tar.gz |
15054 libc: using the result of an assignment as a condition without parentheses
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Approved by: Dan McDonald <danmcd@mnx.io>
Diffstat (limited to 'usr/src/lib/libc/port/gen/regexpr.c')
-rw-r--r-- | usr/src/lib/libc/port/gen/regexpr.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr/src/lib/libc/port/gen/regexpr.c b/usr/src/lib/libc/port/gen/regexpr.c index efa3c2e0f0..90ced76497 100644 --- a/usr/src/lib/libc/port/gen/regexpr.c +++ b/usr/src/lib/libc/port/gen/regexpr.c @@ -25,9 +25,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* All Rights Reserved */ /* * routines to do regular expression matching @@ -294,7 +292,8 @@ re_exec(const char *p1) do { if (*p1 != c) continue; - if (rv = advance(p1, p2)) + rv = advance(p1, p2); + if (rv != 0) return (rv); } while (*p1++); return (0); @@ -303,7 +302,8 @@ re_exec(const char *p1) * regular algorithm */ do { - if (rv = advance(p1, p2)) + rv = advance(p1, p2); + if (rv != 0) return (rv); } while (*p1++); return (0); @@ -381,7 +381,8 @@ advance(const char *lp, char *ep) while (backref(i, lp)) lp += ct; while (lp >= curlp) { - if (rv = advance(lp, ep)) + rv = advance(lp, ep); + if (rv != 0) return (rv); lp -= ct; } @@ -411,7 +412,8 @@ advance(const char *lp, char *ep) star: do { lp--; - if (rv = advance(lp, ep)) + rv = advance(lp, ep); + if (rv != 0) return (rv); } while (lp > curlp); return (0); |