diff mbox series

[BlueZ,2/2] test-runner: fix behavior when no audio server

Message ID 957b9b9c5c06960a6632ec0a90885388f18db4bf.1689180344.git.pav@iki.fi
State Superseded
Headers show
Series [BlueZ,1/2] test-runner: set non-quiet printk before running tests | expand

Commit Message

Pauli Virtanen July 12, 2023, 4:48 p.m. UTC
If no audio server, don't pass NULL to printf and parse TESTAUDIO
correctly.
---
 tools/test-runner.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/test-runner.c b/tools/test-runner.c
index 288901a61..cfb97907f 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -273,7 +273,8 @@  static void start_qemu(void)
 				initcmd, cwd, start_dbus, start_daemon,
 				start_dbus_session,
 				start_monitor, start_emulator, num_devs,
-				run_auto, audio_server, testargs);
+				run_auto, audio_server ? audio_server : "",
+				testargs);
 
 	argv = alloca(sizeof(qemu_argv) +
 				(sizeof(char *) * (4 + (num_devs * 4))));
@@ -1128,7 +1129,7 @@  static void run_tests(void)
 		const char *start = ptr + 11;
 		const char *end = strchr(start, '\'');
 
-		if (end) {
+		if (end && end != start) {
 			audio_server = strndup(start, end - start);
 			printf("Audio server %s requested\n", audio_server);
 		}