]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
also print out offset if the input is long
authorAlan T. DeKok <aland@freeradius.org>
Tue, 22 Aug 2023 12:43:48 +0000 (08:43 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 22 Aug 2023 14:13:12 +0000 (10:13 -0400)
src/bin/unit_test_attribute.c

index 4ad3e467a4f05569c90624451508771803ce6f00..3aff421ae6e3e68aea27dcb16059efcad39e5a75 100644 (file)
@@ -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,