From c4e333bc8b84d72a5bd5cb9ae07694405baa71a7 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Wed, 24 Oct 2018 08:51:38 +0200 Subject: [PATCH] Fix the build on CentOS 6 --- examples/opti-move.cpp | 2 +- src/fvterm.cpp | 2 +- test/ftermdetection-test.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) 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())