Skip to content

Commit 25fba2e

Browse files
kkmisiaszekDuncaen
authored andcommitted
bin/xbps-query: Fix off-by-one error adding ellipsis in list.c
1 parent e8d9e67 commit 25fba2e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/xbps-query/list.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ list_pkgs_in_dict(struct xbps_handle *xhp UNUSED,
8181
short_desc);
8282
/* add ellipsis if the line was truncated */
8383
if (len >= lpc->maxcols && lpc->maxcols > 4) {
84-
for (unsigned int j = 0; j < 3; j++)
85-
lpc->linebuf[lpc->maxcols-j-1] = '.';
86-
lpc->linebuf[lpc->maxcols] = '\0';
84+
lpc->linebuf[lpc->maxcols - 4] = '.';
85+
lpc->linebuf[lpc->maxcols - 3] = '.';
86+
lpc->linebuf[lpc->maxcols - 2] = '.';
8787
}
8888
puts(lpc->linebuf);
8989

0 commit comments

Comments
 (0)