auth:credentials: Avoid an 'else' branch
authorAndreas Schneider <asn@samba.org>
Thu, 1 Mar 2018 10:04:49 +0000 (11:04 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 1 Mar 2018 13:49:45 +0000 (14:49 +0100)
This moves the 'return' statement to the end of the 'case' and makes clear
we leave here.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/credentials/credentials.c

index f9a6bc3..4663185 100644 (file)
@@ -1284,11 +1284,14 @@ _PUBLIC_ bool cli_credentials_parse_password_fd(struct cli_credentials *credenti
                                *p = '\0'; /* null-terminate it, just in case... */
                                p = NULL; /* then force the loop condition to become false */
                                break;
-                       } else {
-                               fprintf(stderr, "Error reading password from file descriptor %d: %s\n", fd, "empty password\n");
-                               return false;
                        }
 
+                       fprintf(stderr,
+                               "Error reading password from file descriptor "
+                               "%d: empty password\n",
+                               fd);
+                       return false;
+
                default:
                        fprintf(stderr, "Error reading password from file descriptor %d: %s\n",
                                        fd, strerror(errno));