From 1bf73ebb97b2f20bf3d8b1adba43fc9fbbc335f6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 27 Jul 2010 11:01:10 -0700 Subject: [PATCH] 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. --- src/sort.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sort.c b/src/sort.c index 588bae80f6..f552d219f6 100644 --- a/src/sort.c +++ b/src/sort.c @@ -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'); } } -- 2.47.3