[multipathd] don't care interpreting "\n" as a cli command
authorChristophe Varoqui <root@xa-s05.(none)>
Fri, 11 Nov 2005 12:48:42 +0000 (13:48 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Fri, 11 Nov 2005 12:48:42 +0000 (13:48 +0100)
CR epileptics like me are happier now.

multipathd>
multipathd>
multipathd>
multipathd>
multipathd>
multipathd>
multipathd>

multipathd/uxclnt.c

index bb08a8a..47d528c 100644 (file)
@@ -25,8 +25,14 @@ static void process(int fd)
 
        while ((line = readline("multipathd> "))) {
                size_t len;
+               size_t llen = strlen(line);
 
-               if (send_packet(fd, line, strlen(line) + 1) != 0) break;
+               if (!llen) {
+                       free(line);
+                       continue;
+               }
+
+               if (send_packet(fd, line, llen + 1) != 0) break;
                if (recv_packet(fd, &reply, &len) != 0) break;
 
                printf("%s", reply);