mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 20:40:34 +01:00
libnm-util, core: fix warning about signed integer overflow (-Wstrict-overflow)
gcc warns:
make[4]: Entering directory `./NetworkManager/libnm-util'
CC nm-value-transforms.lo
nm-value-transforms.c: In function '_nm_utils_convert_op_array_to_string':
nm-value-transforms.c:121:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
if (i > 0)
^
nm-value-transforms.c: In function '_nm_utils_convert_string_array_to_string':
nm-value-transforms.c:121:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
if (i > 0)
^
make[7]: Entering directory `./NetworkManager/src/settings/plugins/ifcfg-rh'
CC reader.lo
reader.c: In function 'make_wired_setting':
reader.c:3295:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
if (!found)
^
reader.c: In function 'wireless_connection_from_ifcfg':
reader.c:3295:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
if (!found)
^
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
f0d40201ae
commit
b835111129
4 changed files with 6 additions and 4 deletions
|
|
@ -114,7 +114,7 @@ static void
|
|||
_string_array_to_string (const GPtrArray *strings, GValue *dest_value)
|
||||
{
|
||||
GString *printable;
|
||||
int i;
|
||||
guint i;
|
||||
|
||||
printable = g_string_new (NULL);
|
||||
for (i = 0; strings && i < strings->len; i++) {
|
||||
|
|
|
|||
|
|
@ -3266,7 +3266,7 @@ fill_8021x (shvarFile *ifcfg,
|
|||
char *lower = NULL;
|
||||
|
||||
lower = g_ascii_strdown (*iter, -1);
|
||||
while (eap->method && !found) {
|
||||
while (eap->method) {
|
||||
if (strcmp (eap->method, lower))
|
||||
goto next;
|
||||
|
||||
|
|
@ -3287,6 +3287,7 @@ fill_8021x (shvarFile *ifcfg,
|
|||
}
|
||||
nm_setting_802_1x_add_eap_method (s_8021x, lower);
|
||||
found = TRUE;
|
||||
break;
|
||||
|
||||
next:
|
||||
eap++;
|
||||
|
|
|
|||
|
|
@ -1383,7 +1383,7 @@ fill_8021x (const char *ssid,
|
|||
char *lower = NULL;
|
||||
|
||||
lower = g_ascii_strdown (*iter, -1);
|
||||
while (eap->method && !found) {
|
||||
while (eap->method) {
|
||||
if (strcmp (eap->method, lower))
|
||||
goto next;
|
||||
|
||||
|
|
@ -1404,6 +1404,7 @@ fill_8021x (const char *ssid,
|
|||
}
|
||||
nm_setting_802_1x_add_eap_method (s_8021x, lower);
|
||||
found = TRUE;
|
||||
break;
|
||||
|
||||
next:
|
||||
eap++;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ test_nm_utils_ascii_str_to_int64_do (const char *str, guint base, gint64 min,
|
|||
NULL,
|
||||
};
|
||||
const char **ws_pre, **ws_post, **null;
|
||||
int i;
|
||||
guint i;
|
||||
|
||||
if (str == NULL || exp_errno != 0) {
|
||||
test_nm_utils_ascii_str_to_int64_check (str, base, min, max, fallback, exp_errno, exp_val);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue