mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 09:08:05 +02:00
dns: minor cleanup in update_dns() to use gsize for size
g_strv_length() returns a guint. That is not the right size for the length of an array. Use the right size.
This commit is contained in:
parent
0e7e88cfc7
commit
f1564caa15
1 changed files with 4 additions and 3 deletions
|
|
@ -1587,7 +1587,6 @@ plugin_skip:;
|
|||
const char *lladdr = "127.0.0.1";
|
||||
gboolean need_edns0;
|
||||
gboolean need_trust;
|
||||
guint len;
|
||||
|
||||
if (NM_IS_DNS_SYSTEMD_RESOLVED(priv->plugin)) {
|
||||
/* systemd-resolved uses a different link-local address */
|
||||
|
|
@ -1602,8 +1601,10 @@ plugin_skip:;
|
|||
need_trust = nm_utils_strv_find_first(options, -1, NM_SETTING_DNS_OPTION_TRUST_AD) < 0;
|
||||
|
||||
if (need_edns0 || need_trust) {
|
||||
len = options ? g_strv_length(options) : 0;
|
||||
options = g_realloc(options, sizeof(char *) * (len + 3));
|
||||
gsize len;
|
||||
|
||||
len = NM_PTRARRAY_LEN(options);
|
||||
options = g_realloc(options, sizeof(char *) * (len + 3u));
|
||||
if (need_edns0)
|
||||
options[len++] = g_strdup(NM_SETTING_DNS_OPTION_EDNS0);
|
||||
if (need_trust)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue