]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a compile warning
authorRoy Marples <roy@marples.name>
Thu, 5 Dec 2013 00:40:03 +0000 (00:40 +0000)
committerRoy Marples <roy@marples.name>
Thu, 5 Dec 2013 00:40:03 +0000 (00:40 +0000)
if-options.c

index e0839048536eb76e11280122d094a785fbadf003..c3ac2f2fa77b64cdca0050409907a29a8ef7ab2c 100644 (file)
@@ -1375,9 +1375,8 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                                return -1;
                        }
                }
-               if (opt == O_EMBED)
-                       dl = *dop_len;
-               else {
+               ndop = NULL;
+               if (opt != O_EMBED) {
                        for (dl = 0; dl < *dop_len; dl++) {
                                ndop = &(*dop)[dl];
                                /* type 0 seems freshly malloced struct
@@ -1386,7 +1385,7 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                                        break;
                        }
                }
-               if (dl >= *dop_len) {
+               if (ndop == NULL) {
                        if ((ndop = realloc(*dop,
                            sizeof(**dop) * ((*dop_len) + 1))) == NULL) {
                                syslog(LOG_ERR, "%s: %m", __func__);