From fae720edc4be2cace6c065c1a8498e7af4e90b3b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 8 Dec 2017 16:25:37 +0100 Subject: [PATCH] cli: fix integer types in get-functions to match libnm origin The num/i variables are initialized from libnm API and used back at them. The integer types should match. (cherry picked from commit e7d18548b9e15ff24b357fc182c1300901495466) --- clients/common/nm-meta-setting-desc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 98dc6d5e24..070ced7498 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -3122,14 +3122,14 @@ _get_fcn_ip_config_addresses (ARGS_GET_FCN) { NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting); GString *printable; - guint32 num_addresses, i; + guint num_addresses, i; NMIPAddress *addr; RETURN_UNSUPPORTED_GET_TYPE (); printable = g_string_new (NULL); - num_addresses = nm_setting_ip_config_get_num_addresses (s_ip); + num_addresses = NM_MIN ((guint) G_MAXINT, nm_setting_ip_config_get_num_addresses (s_ip)); for (i = 0; i < num_addresses; i++) { addr = nm_setting_ip_config_get_address (s_ip, i); @@ -3149,14 +3149,14 @@ _get_fcn_ip_config_routes (ARGS_GET_FCN) { NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting); GString *printable; - guint32 num_routes, i; + guint num_routes, i; NMIPRoute *route; RETURN_UNSUPPORTED_GET_TYPE (); printable = g_string_new (NULL); - num_routes = nm_setting_ip_config_get_num_routes (s_ip); + num_routes = NM_MIN ((guint) G_MAXINT, nm_setting_ip_config_get_num_routes (s_ip)); for (i = 0; i < num_routes; i++) { gs_free char *attr_str = NULL; gs_strfreev char **attr_names = NULL; @@ -3856,7 +3856,7 @@ _get_fcn_team_link_watchers (ARGS_GET_FCN) { NMSettingTeam *s_team = NM_SETTING_TEAM (setting); GString *printable; - guint32 num_watchers, i; + guint num_watchers, i; NMTeamLinkWatcher *watcher; char *watcher_str; @@ -3928,7 +3928,7 @@ _get_fcn_team_port_link_watchers (ARGS_GET_FCN) { NMSettingTeamPort *s_team_port = NM_SETTING_TEAM_PORT (setting); GString *printable; - guint32 num_watchers, i; + guint num_watchers, i; NMTeamLinkWatcher *watcher; char *watcher_str;