diff mbox series

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

Message ID 696a65e1c6790cd194c863c5b4128df7aa533e0f.1689196901.git.pav@iki.fi (mailing list archive)
State Accepted
Commit 9aff3f4941426d6a79d08404e1fe36767eadd0fd
Headers show
Series [BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Pauli Virtanen July 12, 2023, 9:22 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 119e1cfbc..243eab468 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -277,7 +277,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))));
@@ -1132,7 +1133,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);
 		}