summaryrefslogtreecommitdiff
path: root/src/gui/login.cpp
diff options
context:
space:
mode:
authorAlexander Baldeck <alexander@archlinux.org>2004-11-26 16:39:21 +0000
committerAlexander Baldeck <alexander@archlinux.org>2004-11-26 16:39:21 +0000
commit93b7fabac8e250b89227d1d183081326da942ade (patch)
tree058f2bd0a762c4e9750339ba6d20731798af8279 /src/gui/login.cpp
parent428c4cc8bba2e8a385a6f51d3788b7ab3c9ce4c7 (diff)
downloadmana-93b7fabac8e250b89227d1d183081326da942ade.tar.gz
mana-93b7fabac8e250b89227d1d183081326da942ade.tar.bz2
mana-93b7fabac8e250b89227d1d183081326da942ade.tar.xz
mana-93b7fabac8e250b89227d1d183081326da942ade.zip
fix for tmw crash in login() due to too long username in tmw.ini (>25chars) (kth5)
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r--src/gui/login.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index 39a41d27..0fe00db0 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -43,7 +43,10 @@ DIALOG login_dialog[] = {
if(get_config_int("login", "remember", 0)!=0) {
login_dialog[7].flags = D_SELECTED;
- if(get_config_string("login", "username", 0))strcpy(username, get_config_string("login", "username", 0));
+ if(get_config_string("login", "username", 0)) {
+ strncpy(username, get_config_string("login", "username", 0), LEN_USERNAME);
+ username[LEN_USERNAME] = '\0';
+ }
else strcpy(username, "player\0");
}
centre_dialog(login_dialog);