parent
6ad3589964
commit
a5b58f9b3b
|
@ -224,6 +224,8 @@ static unsigned getColumns(int FileID) {
|
||||||
#if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
|
#if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
|
||||||
// Try to determine the width of the terminal.
|
// Try to determine the width of the terminal.
|
||||||
struct winsize ws;
|
struct winsize ws;
|
||||||
|
// Zero-fill ws to avoid a false positive from MemorySanitizer.
|
||||||
|
memset(&ws, 0, sizeof(ws));
|
||||||
if (ioctl(FileID, TIOCGWINSZ, &ws) == 0)
|
if (ioctl(FileID, TIOCGWINSZ, &ws) == 0)
|
||||||
Columns = ws.ws_col;
|
Columns = ws.ws_col;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue