From a43ce34143ffb424141c56939613d0484e14c722 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 8 Feb 2026 08:35:20 -0600 Subject: [PATCH] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/test_atak/test_main.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/test_atak/test_main.cpp b/test/test_atak/test_main.cpp index 59fffcbe5..2ef59844f 100644 --- a/test/test_atak/test_main.cpp +++ b/test/test_atak/test_main.cpp @@ -6,17 +6,10 @@ * Nanopb stores strings as fixed-size char arrays that may contain embedded nulls. * strlen() would stop at the first null, but we need to find the last non-null character. * This is critical for Android UIDs that can contain 0x00 bytes (e.g., ANDROID-e7e455b40002429d). + * + * Use the firmware implementation declared elsewhere so tests exercise the same logic. */ -static size_t pb_string_length(const char *str, size_t max_len) -{ - size_t len = 0; - for (size_t i = 0; i < max_len; i++) { - if (str[i] != '\0') { - len = i + 1; - } - } - return len; -} +extern size_t pb_string_length(const char *str, size_t max_len); void setUp(void) {