From: Roy Marples Date: Thu, 5 Dec 2013 00:40:03 +0000 (+0000) Subject: Fix a compile warning X-Git-Tag: v6.2.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6714b78665d7c946311361ebe3425dcaa2156f07;p=thirdparty%2Fdhcpcd.git Fix a compile warning --- diff --git a/if-options.c b/if-options.c index e0839048..c3ac2f2f 100644 --- a/if-options.c +++ b/if-options.c @@ -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__);