mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-07-26 02:30:35 +02:00
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:
+5
-2
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user