Mercurial > hg > dhcpcd
changeset 2192:11e8ddedaf22 draft
Fix a compile warning
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Thu, 05 Dec 2013 00:40:03 +0000 |
| parents | 0b05aeb7dfc6 |
| children | 5a75bc2628f5 |
| files | if-options.c |
| diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/if-options.c Wed Dec 04 13:21:45 2013 +0000 +++ b/if-options.c Thu Dec 05 00:40:03 2013 +0000 @@ -1375,9 +1375,8 @@ 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 @@ break; } } - if (dl >= *dop_len) { + if (ndop == NULL) { if ((ndop = realloc(*dop, sizeof(**dop) * ((*dop_len) + 1))) == NULL) { syslog(LOG_ERR, "%s: %m", __func__);
