* tests/xattr.c (DEFAULT_STRLEN): New macro.
(main): Use it to limit the length passed to print_quoted_memory.
Print ellipsis when the list returned by listxattr is too long.
# define XATTR_SIZE_MAX 65536
# endif
+#define DEFAULT_STRLEN 32
+
int
main(void)
{
if (rc < 0)
printf("%p", big);
else {
+ const int ellipsis = rc > DEFAULT_STRLEN;
+
putchar('"');
- print_quoted_memory(big, rc);
+ print_quoted_memory(big, ellipsis ? DEFAULT_STRLEN : rc);
putchar('"');
+ if (ellipsis)
+ fputs("...", stdout);
}
printf(", %u) = %s\n", XATTR_SIZE_MAX + 1, errstr);