sort: Fix string length update math

This commit is contained in:
Richard Ipsum 2019-12-31 19:51:00 +00:00 committed by Michael Forney
parent 60895834f0
commit 57c9cab849

2
sort.c
View File

@ -68,8 +68,8 @@ skipcolumn(struct line *a, int skip_to_next_col)
if ((s = memmem(a->data, a->len, fieldsep, fieldseplen))) { if ((s = memmem(a->data, a->len, fieldsep, fieldseplen))) {
if (skip_to_next_col) { if (skip_to_next_col) {
s += fieldseplen; s += fieldseplen;
a->len -= s - a->data;
a->data = s; a->data = s;
a->len = a->len - (s - a->data);
} }
} else { } else {
a->data += a->len - 1; a->data += a->len - 1;