[PATCH] hostapd_cli: Add newline to command output
Gustavo Bertoli
gubertoli at gmail.com
Tue Mar 25 11:19:32 PDT 2025
This patch ensures that output printed by hostapd_cli commands is
terminated with a newline character. The lack of newline caused
DPP-related command outputs — when run via hostapd_cli or wpa_cli —
to appear concatenated or be misinterpreted in scripting or terminal
environments.
For example, running a DPP command like dpp_bootstrap_get_uri would
print the output without a trailing newline, making it harder to
parse or read.
Signed-off-by: Gustavo Bertoli <gubertoli at gmail.com>
---
hostapd/hostapd_cli.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 57702d93b..4dee54cba 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -220,7 +220,7 @@ static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print)
}
if (print) {
buf[len] = '\0';
- printf("%s", buf);
+ printf("%s\n", buf);
}
return 0;
}
--
2.43.0
More information about the Hostap
mailing list