Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-wpa_supplicant_8: 提交

external/wpa_supplicant_8


Commit MetaInfo

修订版9e37fc2607983e5c6879df1041d154a7a015c320 (tree)
时间2014-12-04 04:48:46
作者Dmitry Shmidt <dimitrysh@goog...>
CommiterDmitry Shmidt

Log Message

Return only full network line in list_networks

Change-Id: I81a74db1ba1e4e48397ce779687fffda42cbd8ac
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

更改概述

差异

--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -1984,7 +1984,7 @@ static int wpa_supplicant_ctrl_iface_log_level(struct wpa_supplicant *wpa_s,
19841984 static int wpa_supplicant_ctrl_iface_list_networks(
19851985 struct wpa_supplicant *wpa_s, char *cmd, char *buf, size_t buflen)
19861986 {
1987- char *pos, *end;
1987+ char *pos, *end, *prev;
19881988 struct wpa_ssid *ssid;
19891989 int ret;
19901990
@@ -2009,11 +2009,12 @@ static int wpa_supplicant_ctrl_iface_list_networks(
20092009 }
20102010
20112011 while (ssid) {
2012+ prev = pos;
20122013 ret = os_snprintf(pos, end - pos, "%d\t%s",
20132014 ssid->id,
20142015 wpa_ssid_txt(ssid->ssid, ssid->ssid_len));
20152016 if (ret < 0 || ret >= end - pos)
2016- return pos - buf;
2017+ return prev - buf;
20172018 pos += ret;
20182019 if (ssid->bssid_set) {
20192020 ret = os_snprintf(pos, end - pos, "\t" MACSTR,
@@ -2022,7 +2023,7 @@ static int wpa_supplicant_ctrl_iface_list_networks(
20222023 ret = os_snprintf(pos, end - pos, "\tany");
20232024 }
20242025 if (ret < 0 || ret >= end - pos)
2025- return pos - buf;
2026+ return prev - buf;
20262027 pos += ret;
20272028 ret = os_snprintf(pos, end - pos, "\t%s%s%s%s",
20282029 ssid == wpa_s->current_ssid ?
@@ -2033,11 +2034,11 @@ static int wpa_supplicant_ctrl_iface_list_networks(
20332034 ssid->disabled == 2 ? "[P2P-PERSISTENT]" :
20342035 "");
20352036 if (ret < 0 || ret >= end - pos)
2036- return pos - buf;
2037+ return prev - buf;
20372038 pos += ret;
20382039 ret = os_snprintf(pos, end - pos, "\n");
20392040 if (ret < 0 || ret >= end - pos)
2040- return pos - buf;
2041+ return prev - buf;
20412042 pos += ret;
20422043
20432044 ssid = ssid->next;
Show on old repository browser