aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2016-04-15 13:29:26 +0200
committerFlorian Weimer <fweimer@redhat.com>2016-06-02 13:13:01 +0200
commit861a38359832548ffed4e38dc5f7fecd0a5a0264 (patch)
tree04af95dddd63e86d3d6134235f776918859b740f /stdlib
parenta79b262c1e68098701da6ac34bd1ba8ca8413961 (diff)
downloadglibc-861a38359832548ffed4e38dc5f7fecd0a5a0264.zip
glibc-861a38359832548ffed4e38dc5f7fecd0a5a0264.tar.gz
glibc-861a38359832548ffed4e38dc5f7fecd0a5a0264.tar.bz2
Suppress GCC 6 warning about ambiguous 'else' with -Wparentheses
(cherry picked from commit df1cf48777fe4cd81ad7fb09ecbe5b31432b7c1c)
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/setenv.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/stdlib/setenv.c b/stdlib/setenv.c
index b9e0ba8..7a87d64 100644
--- a/stdlib/setenv.c
+++ b/stdlib/setenv.c
@@ -289,18 +289,20 @@ unsetenv (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;