diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index 810932a0..208c317c 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -75,7 +75,7 @@ void term_boundaries (int& x, int& y) if ( y < 0 ) y = 0; - if ( x >= term_width ) + if ( x >= term_width && term_width > 0 ) { y += x / term_width; x %= term_width; diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 565f7c1a..387737e7 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -113,7 +113,7 @@ void FVTerm::setTermXY (int x, int y) term_width = int(getColumnNumber()); term_height = int(getLineNumber()); - if ( x >= term_width ) + if ( x >= term_width && term_width > 0 ) { y += x / term_width; x %= term_width; diff --git a/test/ftermdetection-test.cpp b/test/ftermdetection-test.cpp index 9d5187b7..b5edec56 100644 --- a/test/ftermdetection-test.cpp +++ b/test/ftermdetection-test.cpp @@ -28,10 +28,11 @@ #include #include -#include #include #include +#include + #define CPPUNIT_ASSERT_CSTRING(expected, actual) \ check_c_string (expected, actual, CPPUNIT_SOURCELINE())