]> git.ipfire.org Git - thirdparty/util-linux.git/commit
col: make flush_line() a little bit robust
authorKarel Zak <kzak@redhat.com>
Tue, 5 Feb 2019 11:06:00 +0000 (12:06 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 5 Feb 2019 11:06:00 +0000 (12:06 +0100)
commit004356f05018e3bfcaddd2652846659a4d8481f3
tree929322081416c99c0b9d15b7c0fa12b7a9058da8
parentf571d10d4a3c82e5643770db91c91baf4e8fa4aa
col: make flush_line() a little bit robust

The code is horrible. The core of the problem are signed integers
and no check for the limits.

This patch fixes c->c_column = cur_col; where c_column is "short"
and "cur_col" is int. Let's use "int" for all the variables. It's
really not perfect as for bigger lines it can segfault again...

The patch also removes some unnecessary static variables.

Addresses: https://github.com/karelzak/util-linux/issues/749
Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/col.c