diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2016-04-15 13:29:26 +0200 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2016-04-20 10:43:40 +0100 |
commit | 5769d5d17cdb4770f1e08167b76c1684ad4e1f73 (patch) | |
tree | 5ab6a86e988ad0616fc051140c49f3af399084ff /stdlib/setenv.c | |
parent | f1e182acaaa84e844eb96462a92ba532e1c1fff4 (diff) | |
download | glibc-5769d5d17cdb4770f1e08167b76c1684ad4e1f73.zip glibc-5769d5d17cdb4770f1e08167b76c1684ad4e1f73.tar.gz glibc-5769d5d17cdb4770f1e08167b76c1684ad4e1f73.tar.bz2 |
Suppress GCC 6 warning about ambiguous 'else' with -Wparentheses
(cherry picked from commit df1cf48777fe4cd81ad7fb09ecbe5b31432b7c1c)
Diffstat (limited to 'stdlib/setenv.c')
-rw-r--r-- | stdlib/setenv.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/stdlib/setenv.c b/stdlib/setenv.c index da61ee0..e66045f 100644 --- a/stdlib/setenv.c +++ b/stdlib/setenv.c @@ -278,18 +278,20 @@ unsetenv (const char *name) ep = __environ; if (ep != NULL) while (*ep != NULL) - if (!strncmp (*ep, name, len) && (*ep)[len] == '=') - { - /* Found it. Remove this pointer by moving later ones back. */ - char **dp = ep; - - do - dp[0] = dp[1]; - while (*dp++); - /* Continue the loop in case NAME appears again. */ - } - else - ++ep; + { + if (!strncmp (*ep, name, len) && (*ep)[len] == '=') + { + /* Found it. Remove this pointer by moving later ones back. */ + char **dp = ep; + + do + dp[0] = dp[1]; + while (*dp++); + /* Continue the loop in case NAME appears again. */ + } + else + ++ep; + } UNLOCK; |