diff options
author | Cyril Brulebois <kibi@debian.org> | 2011-05-25 04:00:20 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2011-05-26 08:20:01 -0700 |
commit | 7e8bf96206b71d69e5a8b00eb63d8221c6710b24 (patch) | |
tree | e67fa5a4e15136ab32af30e81fd33c51e5d331f2 | |
parent | 0ac2960a534d6be9b8de6ae4ae2b59b572258cd5 (diff) |
xts5: Add parentheses around assignment in an if.
Tell compilers we really meant to assign and then check.
The following warning goes away accordingly:
| CC nextvclass.lo
| nextvclass.c:224:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
| if (comma = strchr(++s, COMMA))
| ~~~~~~^~~~~~~~~~~~~~~~~~~~
| nextvclass.c:224:14: note: use '==' to turn this assignment into an equality comparison
| if (comma = strchr(++s, COMMA))
| ^
| ==
| nextvclass.c:224:14: note: place parentheses around the assignment to silence this warning
| if (comma = strchr(++s, COMMA))
| ^
| ( )
Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r-- | xts5/src/lib/nextvclass.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xts5/src/lib/nextvclass.c b/xts5/src/lib/nextvclass.c index 13b7f6cb..7a6a5f25 100644 --- a/xts5/src/lib/nextvclass.c +++ b/xts5/src/lib/nextvclass.c @@ -221,7 +221,7 @@ int Lclass; } Lclass = Nclass; for (s = left_bracket; s; s = comma) { - if (comma = strchr(++s, COMMA)) + if ((comma = strchr(++s, COMMA))) *comma = '\0'; if (*s == '\0') break; |