From 2401429048390dde22fc1e81fb3102f402e62cfc Mon Sep 17 00:00:00 2001 From: yuripv Date: Tue, 14 Jul 2020 22:43:40 +0000 Subject: [PATCH] top: VIS_SAFE turned out to be unsafe Unset VIS_SAFE flag as it turned out to be actually unsafe for continuos top display as it's passing through sequences resulting cursor movement (backspace, tab, carriage-return), and explicitly set VIS_TAB for the same reason. Reported by: Mark Millard , swills Tested by: Mark Millard , swills --- usr.bin/top/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 476432e5db0c..c7b3e13c700b 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1016,7 +1016,7 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags len = (argbuflen - (dst - argbuf) - 1) / 4; strvisx(dst, src, MIN(strlen(src), len), - VIS_NL | VIS_CSTYLE | VIS_OCTAL | VIS_SAFE); + VIS_NL | VIS_TAB | VIS_CSTYLE | VIS_OCTAL); while (*dst != '\0') dst++; if ((argbuflen - (dst - argbuf) - 1) / 4 > 0)