mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 00:00:08 +01:00
cloud-setup: use _nm_utils_ascii_str_to_int64_bin() in Azure's _get_config_fetch_done_cb()
This commit is contained in:
parent
d3f07d5ca2
commit
a2fded3cee
1 changed files with 2 additions and 8 deletions
|
|
@ -154,14 +154,9 @@ _get_config_fetch_done_cb(NMHttpClient * http_client,
|
|||
iface_get_config->has_ipv4s = TRUE;
|
||||
iface_get_config->ipv4s_len++;
|
||||
} else {
|
||||
int tmp_prefix = -1;
|
||||
|
||||
if (fip_len > 0 && memchr(fip_str, '\0', fip_len - 1)) {
|
||||
/* we have an embedded "\0" inside the string (except trailing). That is not
|
||||
* allowed*/
|
||||
} else
|
||||
tmp_prefix = _nm_utils_ascii_str_to_int64(fip_str, 10, 0, 32, -1);
|
||||
int tmp_prefix;
|
||||
|
||||
tmp_prefix = _nm_utils_ascii_str_to_int64_bin(fip_str, fip_len, 10, 0, 32, -1);
|
||||
if (tmp_prefix == -1) {
|
||||
_LOGD("interface[%" G_GSSIZE_FORMAT "]: invalid prefix", iface_data->intern_iface_idx);
|
||||
error =
|
||||
|
|
@ -244,7 +239,6 @@ _get_config_ips_prefix_list_cb(GObject *source, GAsyncResult *result, gpointer u
|
|||
((char *) line)[--line_len] = '\0';
|
||||
|
||||
ips_prefix_idx = _nm_utils_ascii_str_to_int64(line, 10, 0, G_MAXINT64, -1);
|
||||
|
||||
if (ips_prefix_idx < 0)
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue