]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix new dhcp environment options
authorRoy Marples <roy@marples.name>
Mon, 5 May 2014 20:18:14 +0000 (20:18 +0000)
committerRoy Marples <roy@marples.name>
Mon, 5 May 2014 20:18:14 +0000 (20:18 +0000)
dhcp.c
script.c

diff --git a/dhcp.c b/dhcp.c
index 0ad7873407cf26f0d1532e35e1dc3f5ad26bd897..272e926b5e0771e3a5af1fbd292768c73dfd2442 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1158,7 +1158,7 @@ dhcp_env(char **env, const char *prefix, const struct dhcp_message *dhcp,
        ifo = ifp->options;
        get_option_uint8(ifp->ctx, &overl, dhcp, DHO_OPTIONSOVERLOADED);
 
-       if (!env) {
+       if (env == NULL) {
                if (dhcp->yiaddr || dhcp->ciaddr)
                        e += 5;
                if (*dhcp->bootfile && !(overl & 1))
index ca8a455cc8548747bca86a32a7b54c4acf1c2a32..bee200c491a8f6c50cccb2d0ece43e3007911b7d 100644 (file)
--- a/script.c
+++ b/script.c
@@ -408,7 +408,7 @@ dumplease:
 #ifdef INET
        if (dhcp && state && state->new) {
                n = dhcp_env(NULL, NULL, state->new, ifp);
-               if (e > 0) {
+               if (n > 0) {
                        nenv = realloc(env, sizeof(char *) *
                            (elen + (size_t)n + 1));
                        if (nenv == NULL)