]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Test length, not null.
authorRoy Marples <roy@marples.name>
Sat, 17 Jan 2009 00:43:08 +0000 (00:43 +0000)
committerRoy Marples <roy@marples.name>
Sat, 17 Jan 2009 00:43:08 +0000 (00:43 +0000)
dhcpcd.c

index 58d1b88286cc3056b6bdee59d75f173265ad6ab5..4e120c64797a9dd21e62deff0d0eef3a4efa2a62 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1126,7 +1126,7 @@ handle_args(struct fd_list *fd, int argc, char **argv)
                        return 0;
                } else if (strcmp(*argv, "--getinterfaces") == 0) {
                        len = 0;
-                       if (argv[1] == NULL) {
+                       if (argc == 1) {
                                for (ifp = ifaces; ifp; ifp = ifp->next)
                                        len++;
                                write(fd->fd, &len, sizeof(len));