From: Thomas Cort Date: Sun, 16 Feb 2014 20:08:20 +0000 (+0000) Subject: mined: fix dangling else X-Git-Tag: v3.3.0~644 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch10.html?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F1427%2F1;p=minix.git mined: fix dangling else Add braces to avoid ambiguity. Resolves the following warning: mined1.c:1355:5: warning: add explicit braces to avoid dangling else [-Wdangling-else] Change-Id: I64e2942835e45869010f0b8bbef2fe880d0852dc --- diff --git a/commands/mined/mined1.c b/commands/mined/mined1.c index 937320a0a..092a79199 100644 --- a/commands/mined/mined1.c +++ b/commands/mined/mined1.c @@ -1349,13 +1349,14 @@ int get_line(int fd, register char *buffer) if (read_chars <= 0) { if (buffer == begin) return ERRORS; - if (*(buffer - 1) != '\n') - if (loading == TRUE) /* Add '\n' to last line of file */ + if (*(buffer - 1) != '\n') { + if (loading == TRUE) { /* Add '\n' to last line of file */ *buffer++ = '\n'; - else { + } else { *buffer = '\0'; return NO_LINE; } + } } *buffer = '\0';