]> Zhao Yanbai Git Server - minix.git/commitdiff
mined: fix dangling else 27/1427/1
authorThomas Cort <tcort@minix3.org>
Sun, 16 Feb 2014 20:08:20 +0000 (20:08 +0000)
committerThomas Cort <tcort@minix3.org>
Sun, 16 Feb 2014 22:54:40 +0000 (17:54 -0500)
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

commands/mined/mined1.c

index 937320a0aa0e89372f3505d2fe2589e4348f86ce..092a791990828e54e78069de19806980a8f3b2ce 100644 (file)
@@ -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';