mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 00:20:11 +01:00
libnm: workaround compiler warning in nm_sock_addr_endpoint_new()
gcc-12.2.1_git20220924-r4 (on Alpine Linux) warns:
../src/libnm-core-impl/nm-utils.c: In function 'nm_sock_addr_endpoint_new':
../src/libnm-core-impl/nm-utils.c:168:18: error: 'port' may be used uninitialized [-Werror=maybe-uninitialized]
168 | ep->port = port;
| ~~~~~~~~~^~~~~~
../src/libnm-core-impl/nm-utils.c:150:25: note: 'port' was declared here
150 | guint16 port;
| ^~~~
Workaround.
Fixes: 713e879d76 ('libnm: add NMSockAddrEndpoint API')
(cherry picked from commit 3515324e90)
This commit is contained in:
parent
0a43082efa
commit
b73230ee20
1 changed files with 1 additions and 1 deletions
|
|
@ -147,7 +147,7 @@ nm_sock_addr_endpoint_new(const char *endpoint)
|
|||
gsize i;
|
||||
gs_free char *host_clone = NULL;
|
||||
const char *host;
|
||||
guint16 port;
|
||||
guint16 port = 0;
|
||||
|
||||
g_return_val_if_fail(endpoint, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue