From 25fba2eb00eed513709d7545030b30871f9a8f8c Mon Sep 17 00:00:00 2001 From: Kacper Misiaszek Date: Tue, 18 Nov 2025 14:36:35 +0100 Subject: [PATCH] bin/xbps-query: Fix off-by-one error adding ellipsis in list.c --- bin/xbps-query/list.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/xbps-query/list.c b/bin/xbps-query/list.c index cf853314c..b16663dce 100644 --- a/bin/xbps-query/list.c +++ b/bin/xbps-query/list.c @@ -81,9 +81,9 @@ list_pkgs_in_dict(struct xbps_handle *xhp UNUSED, short_desc); /* add ellipsis if the line was truncated */ if (len >= lpc->maxcols && lpc->maxcols > 4) { - for (unsigned int j = 0; j < 3; j++) - lpc->linebuf[lpc->maxcols-j-1] = '.'; - lpc->linebuf[lpc->maxcols] = '\0'; + lpc->linebuf[lpc->maxcols - 4] = '.'; + lpc->linebuf[lpc->maxcols - 3] = '.'; + lpc->linebuf[lpc->maxcols - 2] = '.'; } puts(lpc->linebuf);