1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-05 13:18:06 +03:00

test: Fix a maybe-uninitialised compiler warning (#5269)

The compiler warning is a false positive, since n_addresses is always
initialised on the success path from parse_argv(), but the compiler
obviously can’t work that out.

Fixes:
   src/test/test-nss.c:426:9: warning: 'n_addresses' may be used uninitialized in this function [-Wmaybe-uninitialized]
This commit is contained in:
Philip Withnall 2017-02-08 15:53:01 +00:00 committed by Lennart Poettering
parent 8a50cf6957
commit 6a909d41e1

View File

@ -511,7 +511,7 @@ int main(int argc, char **argv) {
_cleanup_free_ char *dir = NULL;
_cleanup_strv_free_ char **modules = NULL, **names = NULL;
_cleanup_free_ struct local_address *addresses = NULL;
int n_addresses;
int n_addresses = 0;
char **module;
int r;