]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
print out more text around mismatch so we can better find it
authorAlan T. DeKok <aland@freeradius.org>
Mon, 21 Aug 2023 15:18:45 +0000 (11:18 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 21 Aug 2023 15:18:45 +0000 (11:18 -0400)
src/bin/unit_test_attribute.c

index 95b3830d70dba0f5c7d85de60ce813a8a8015087..4ad3e467a4f05569c90624451508771803ce6f00 100644 (file)
@@ -359,10 +359,11 @@ 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) < 128) {
+               if ((e - expected) < 80) {
                        ERROR("             %s^ differs here", spaces);
                } else {
-                       ERROR("             %s^ differs here (%zu)", spaces, e - expected);
+                       ERROR("             %s^ differs here (%zu) ... %.*s ...", spaces, e - expected,
+                             16, e);
                }
                talloc_free(spaces);
        }