[PATCH] wpa_supplicant: Added newline to the pin string printed to the user

Guy Eilam guy at wizery.com
Mon Feb 14 04:25:37 EST 2011


Added a newline at the end of the pin string for both
generated pin and given pin from the user.
In case the user runs the "wps pin" command from inside
the cli, the pin number printed to the user might be
erased after less then a second by the following messages in
the connection process when there is no newline.

Signed-off-by: Guy Eilam <guy at wizery.com>
---
 wpa_supplicant/ctrl_iface.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 0f98d68..bce6a5b 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -262,7 +262,7 @@ static int wpa_supplicant_ctrl_iface_wps_pin(struct wpa_supplicant *wpa_s,
 					 DEV_PW_DEFAULT);
 		if (ret < 0)
 			return -1;
-		ret = os_snprintf(buf, buflen, "%s", pin);
+		ret = os_snprintf(buf, buflen, "%s\n", pin);
 		if (ret < 0 || (size_t) ret >= buflen)
 			return -1;
 		return ret;
@@ -273,7 +273,7 @@ static int wpa_supplicant_ctrl_iface_wps_pin(struct wpa_supplicant *wpa_s,
 		return -1;
 
 	/* Return the generated PIN */
-	ret = os_snprintf(buf, buflen, "%08d", ret);
+	ret = os_snprintf(buf, buflen, "%08d\n", ret);
 	if (ret < 0 || (size_t) ret >= buflen)
 		return -1;
 	return ret;
-- 
1.7.1



More information about the HostAP mailing list