From 64ec0f49a37d29dd1b5bba7af3a734691ffcb01d Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 8 Feb 2013 18:46:03 -0500 Subject: [PATCH] client: Fix typos for Android --- client/hostinfo_network.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/client/hostinfo_network.cpp b/client/hostinfo_network.cpp index 0ff7e1d474..e043bc4c0c 100644 --- a/client/hostinfo_network.cpp +++ b/client/hostinfo_network.cpp @@ -64,19 +64,16 @@ // bool HOST_INFO::host_wifi_online() { char wifipath_pri[1024]; - snprintf(wifipath_pri, sizeof(wifipath_pri), char wifipath_sec[1024]; - snprintf(wifipath_sec, sizeof(wifipath_sec), - - FILE *f = fopen("/sys/class/net/eth0/operstate", "r"); - // location in Android 2.3 - if (!fsyswifi) { - fsyswifi = fopen("/sys/class/net/wlan0/operstate", "r"); - // location in Android 4 - } - char wifi_state[64]; + // location in Android 2.3 + FILE *f = fopen("/sys/class/net/eth0/operstate", "r"); + if (!f) { + // location in Android 4 + f = fopen("/sys/class/net/wlan0/operstate", "r"); + } + if (f) { fgets(wifi_state, 64, f); fclose(f);