sort: fix --debug display with very large offsets

* src/sort.c (mark_key): Don't assume offset <= INT_MAX.
Make the code a bit clearer when width != 0.
This commit is contained in:
Paul Eggert committed 2010-07-27 11:01:48 -07:00
1 parent c8d3838681
commit 1bf73ebb97
1 file changed
+5 -2
+5 -2
View File
@@ -2162,14 +2162,17 @@ count_tabs (char const *text, size_t len)
static void
mark_key (size_t offset, size_t width)
{
printf ("%*s", (int) offset, "");
while (offset--)
putchar (' ');
if (!width)
printf (_("^ no match for key\n"));
else
{
while (width--)
do
putchar ('_');
while (--width);
putchar ('\n');
}
}