]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hs20-osu-client: Hide a trivial compiler warning
authorMasashi Honma <masashi.honma@gmail.com>
Mon, 6 Feb 2017 11:07:44 +0000 (20:07 +0900)
committerJouni Malinen <j@w1.fi>
Mon, 6 Feb 2017 17:28:34 +0000 (19:28 +0200)
This patch hides a compiler warning:

osu_client.c: In function ‘cmd_osu_select’:
osu_client.c:2200:2: warning: ‘osu_count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  for (i = 0; i < osu_count; i++) {
  ^

osu_count is actually initialized in parse_osu_providers() if non-NULL
value is returned.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
hs20/client/osu_client.c

index c05c57d44f896b51267d270ae82f1c1d943f218b..d73feb14b52885372365603edd888453091f3a04 100644 (file)
@@ -2134,7 +2134,7 @@ static int cmd_osu_select(struct hs20_osu_client *ctx, const char *dir,
        char fname[255];
        FILE *f;
        struct osu_data *osu = NULL, *last = NULL;
-       size_t osu_count, i, j;
+       size_t osu_count = 0, i, j;
        int ret;
 
        write_summary(ctx, "OSU provider selection");