summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEmmanuel VAUTRIN <emmanuel.vautrin@gmail.com>2021-10-18 10:16:01 +0200
committerDaniel Wagner <wagi@monom.org>2021-10-20 08:09:50 +0200
commit7470e07ef3b90f7ff729b63fbf541a95d7de2835 (patch)
tree60c4103c57683e31bfad61a272085107e733d359 /tools
parentae921c60a5b94be42f4f733148813a22d48efd97 (diff)
downloadconnman-7470e07ef3b90f7ff729b63fbf541a95d7de2835.tar.gz
tools: Fix uninitialized errors in iptables tests
gcc reports with: tools/iptables-test.c: In function 'main': tools/iptables-test.c:148:3: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized] 148 | exit(err); | ^~~~~~~~~ tools/ip6tables-test.c: In function 'main': tools/ip6tables-test.c:149:3: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized] 149 | exit(err); | ^~~~~~~~~
Diffstat (limited to 'tools')
-rw-r--r--tools/ip6tables-test.c2
-rw-r--r--tools/iptables-test.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/ip6tables-test.c b/tools/ip6tables-test.c
index 41e842dd..a52f4af0 100644
--- a/tools/ip6tables-test.c
+++ b/tools/ip6tables-test.c
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
{
enum iptables_command cmd = IPTABLES_COMMAND_UNKNOWN;
char *table = NULL, *chain = NULL, *rule = NULL, *tmp;
- int err, c, i;
+ int err = -EINVAL, c, i;
opterr = 0;
diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index e9b7cb22..f9d091eb 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
{
enum iptables_command cmd = IPTABLES_COMMAND_UNKNOWN;
char *table = NULL, *chain = NULL, *rule = NULL, *tmp;
- int err, c, i;
+ int err = -EINVAL, c, i;
opterr = 0;