diff --git a/ChangeLog b/ChangeLog index 34040ffb..2bb83e6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-02 Tatsuhiro Tsujikawa + + Only decrement cols if cols > 0 + * src/ConsoleStatCalc.cc + 2009-11-02 Tatsuhiro Tsujikawa Updated Polish, Catalan, French, Italian, Russian and Japanese diff --git a/src/ConsoleStatCalc.cc b/src/ConsoleStatCalc.cc index ff60b0cc..ec12e828 100644 --- a/src/ConsoleStatCalc.cc +++ b/src/ConsoleStatCalc.cc @@ -217,8 +217,10 @@ ConsoleStatCalc::calculateStat(const DownloadEngine* e) if(ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) == 0) { cols = size.ws_col; #ifdef __MINGW32__ - // Windows terminal cannot handle at the end of line properly. - --cols; + if(cols > 0) { + // Windows terminal cannot handle at the end of line properly. + --cols; + } #endif // __MINGW32__ } #endif // HAVE_TERMIOS_H