From 58c3e6c2ab930f4b71b3221b2cd165e4e9333d77 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Fri, 9 May 2025 07:55:39 -0400 Subject: [PATCH] build: Fix a -fanalyze issue in the tests. --- src/ssb.tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ssb.tests.c b/src/ssb.tests.c index 2b167c41..5b942fc8 100644 --- a/src/ssb.tests.c +++ b/src/ssb.tests.c @@ -1582,7 +1582,7 @@ void tf_ssb_test_cli(const tf_test_options_t* options) snprintf(command, sizeof(command), "%s get_sequence -i %s -d out/test_db0.sqlite", options->exe_path, id); char* sequence = _trim(_subprocess_check_output(command)); - if (strcmp(sequence, "2") != 0) + if (!sequence || strcmp(sequence, "2") != 0) { tf_printf("sequence = %s (expected 1)\n", sequence); abort(); @@ -1592,7 +1592,7 @@ void tf_ssb_test_cli(const tf_test_options_t* options) snprintf(command, sizeof(command), "%s get_profile -i %s -d out/test_db0.sqlite", options->exe_path, id); char* profile = _trim(_subprocess_check_output(command)); const char* k_expected_profile = "{\"name\":\"test_user\"}"; - if (strcmp(profile, k_expected_profile) != 0) + if (!profile || strcmp(profile, k_expected_profile) != 0) { tf_printf("profile = %s (expected \"%s\")\n", profile, k_expected_profile); abort();