dispatcher: refactor constructing environment variables from strv
authorThomas Haller <thaller@redhat.com>
Fri, 5 Dec 2014 12:45:19 +0000 (13:45 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 8 Dec 2014 18:14:31 +0000 (19:14 +0100)
commit37361a038f0dbc503943552d9bf4297451bea417
tree1b7b2701d2b6483301823b3424bea1b00193b6dc
parent937a5639fccd8eb295e9bf2f11a5774cb1989195
dispatcher: refactor constructing environment variables from strv

This also avoids warnings with -O2 -Wstrict-overflow (gcc-4.8.3):

    make[4]: Entering directory `./NetworkManager/callouts'
      CC       libtest_dispatcher_envp_la-nm-dispatcher-utils.lo
    nm-dispatcher-utils.c: In function 'construct_ip6_items':
    nm-dispatcher-utils.c:283:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
         if (i != 0)
            ^
    nm-dispatcher-utils.c: In function 'construct_ip4_items':
    nm-dispatcher-utils.c:144:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
         if (i != 0)
            ^
    nm-dispatcher-utils.c:168:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
         if (i != 0)
            ^

https://bugzilla.gnome.org/show_bug.cgi?id=741168
callouts/nm-dispatcher-utils.c