From: Alan T. DeKok Date: Tue, 22 Aug 2023 12:43:48 +0000 (-0400) Subject: also print out offset if the input is long X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08c098c4c00a470d80a1567f25ab99c547855460;p=thirdparty%2Ffreeradius-server.git also print out offset if the input is long --- diff --git a/src/bin/unit_test_attribute.c b/src/bin/unit_test_attribute.c index 4ad3e467a4f..3aff421ae6e 100644 --- a/src/bin/unit_test_attribute.c +++ b/src/bin/unit_test_attribute.c @@ -359,7 +359,7 @@ static void mismatch_print(command_file_ctx_t *cc, char const *command, spaces = talloc_zero_array(NULL, char, (e - expected) + 1); memset(spaces, ' ', talloc_array_length(spaces) - 1); - if ((e - expected) < 80) { + if (((e - expected) < 80) && (expected_len < 80)) { ERROR(" %s^ differs here", spaces); } else { ERROR(" %s^ differs here (%zu) ... %.*s ...", spaces, e - expected,