tStrings longer than the screen width now really should be displayed properly! … | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit ce396c47d1a0063856c581d2028b88bbd91111a9 | |
parent 0f37a6cb982e4c765e9762cc6368eaad830ea186 | |
Author: Ben Webb <[email protected]> | |
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(-) | |
--- | |
diff --git a/src/curses_client/curses_client.c b/src/curses_client/curses_clien… | |
t@@ -187,10 +187,10 @@ static void LogMessage(const gchar *log_domain, GLogLeve… | |
*/ | |
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); | |
} | |