tStrings longer than the screen width now really should be displayed properly! - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit ce396c47d1a0063856c581d2028b88bbd91111a9
(DIR) parent 0f37a6cb982e4c765e9762cc6368eaad830ea186
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Wed, 7 Aug 2002 11:55:11 +0000
Strings longer than the screen width now really should be displayed properly!
Diffstat:
M src/curses_client/curses_client.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/src/curses_client/curses_client.c b/src/curses_client/curses_client.c
t@@ -187,10 +187,10 @@ static void LogMessage(const gchar *log_domain, GLogLevelFlags log_level,
*/
static void mvaddcentstr(const int row, const gchar *str)
{
- int col;
+ guint col, len;
- col = (Width - strlen(str)) / 2;
- col = MAX(col, 0);
+ len = strlen(str);
+ col = (len > Width ? 0 : (Width - len) / 2);
mvaddstr(row, col, str);
}