Another win for short circuit evaluation
[citadel] / ctdlsh / shutdown.c
index a3c253f..04ec1f2 100644 (file)
@@ -5,22 +5,23 @@
 
 #include "ctdlsh.h"
 
-int cmd_shutdown(int server_socket, char *cmdbuf) {
+int cmd_shutdown(int server_socket, char *cmdbuf)
+{
        char buf[1024];
 
        char *p1 = readline("Do you really want to shut down the Citadel server? ");
 
        if (strncasecmp(p1, "y", 1)) {
-               return(cmdret_ok);
+               return (cmdret_ok);
        }
 
-       sock_puts("DOWN");
+       sock_puts(server_socket, "DOWN");
        sock_getln(server_socket, buf, sizeof buf);
        if (buf[0] != '2') {
                fprintf(stderr, "%s\n", &buf[4]);
-               return(cmdret_error);
+               return (cmdret_error);
        }
 
        fprintf(stderr, "%s\n", &buf[4]);
-       return(cmdret_ok);
+       return (cmdret_ok);
 }