Parcourir la source

wpa_cli: Add newline to end of responses in interactive mode

Some of the wpa_supplicant control interface commands, like WPS_PIN,
may not include a newline in the end of the response. This can result
in the response being lost when wpa_cli redraws the screen after an
event message. Add a newline after such responses in interactive mode
to avoid the problem.
Jouni Malinen il y a 14 ans
Parent
commit
a432bafbca
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      wpa_supplicant/wpa_cli.c

+ 2 - 0
wpa_supplicant/wpa_cli.c

@@ -254,6 +254,8 @@ static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd, int print)
 	if (print) {
 		buf[len] = '\0';
 		printf("%s", buf);
+		if (interactive && len > 0 && buf[len - 1] != '\n')
+			printf("\n");
 	}
 	return 0;
 }