mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 00:00:08 +01:00
platform/test: fix warning about uninitialized value
gcc warns:
make[5]: Entering directory `./NetworkManager/src/platform/tests'
CC platform.o
platform.c: In function ‘do_ip6_route_add’:
platform.c:696:2: error: ‘plen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
return nm_platform_ip6_route_add (ifindex, NM_PLATFORM_SOURCE_USER,
^
platform.c: In function ‘do_ip6_route_delete’:
platform.c:724:2: error: ‘plen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
return nm_platform_ip6_route_delete (ifindex, network, plen, metric);
^
platform.c: In function ‘do_ip4_route_delete’:
[...]
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
996b31ec20
commit
f808c3603a
1 changed files with 3 additions and 0 deletions
|
|
@ -532,6 +532,9 @@ parse_ip_address (int family, char *str, gpointer address, int *plen)
|
|||
{
|
||||
char *endptr;
|
||||
|
||||
if (plen)
|
||||
*plen = 0;
|
||||
|
||||
if (plen) {
|
||||
char *ptr = strchr (str, '/');
|
||||
if (ptr) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue