DBus booleans seem to stamp on more space than a C99 boolean
authorRoy Marples <roy@marples.name>
Thu, 3 Dec 2009 20:53:54 +0000 (20:53 +0000)
committerRoy Marples <roy@marples.name>
Thu, 3 Dec 2009 20:53:54 +0000 (20:53 +0000)
src/libdhcpcd/main.c

index eef3ee8c56d4ba4f74a6699481ed0f12dd158168..7bffcbe1548ccd8de7c5e885b2751d3c3cef87ee 100644 (file)
@@ -397,8 +397,7 @@ dhcpcd_if_new(DHCPCD_CONNECTION *con, DBusMessageIter *array, char **order)
        DHCPCD_IF *i;
        char *s;
        uint32_t u32;
-       bool b;
-       int errors;
+       int b, errors;
 
        if (dbus_message_iter_get_arg_type(array) != DBUS_TYPE_ARRAY) {
                errno = EINVAL;
@@ -434,6 +433,8 @@ dhcpcd_if_new(DHCPCD_CONNECTION *con, DBusMessageIter *array, char **order)
                                break;
                        strlcpy(i->reason, s, sizeof(i->reason));
                } else if (strcmp(s, "Wireless") == 0) {
+                       /* b is an int as DBus booleans want more space than
+                        * a C99 boolean */
                        if (!dhcpcd_iter_get(con, &var, DBUS_TYPE_BOOLEAN, &b))
                                break;
                        i->wireless = b;
@@ -444,7 +445,7 @@ dhcpcd_if_new(DHCPCD_CONNECTION *con, DBusMessageIter *array, char **order)
                } else if (strcmp(s, "IPAddress") == 0) {
                        if (!dhcpcd_iter_get(con, &var, DBUS_TYPE_UINT32, &u32))
                                break;
-                               i->ip.s_addr = u32;
+                       i->ip.s_addr = u32;
                } else if (strcmp(s, "SubnetCIDR") == 0)
                        dbus_message_iter_get_basic(&var, &i->cidr);
                else if (order != NULL && strcmp(s, "InterfaceOrder") == 0)