-rw-r--r-- | noncore/games/kbill/UI.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/noncore/games/kbill/UI.cpp b/noncore/games/kbill/UI.cpp index 611cebf..a49c3c1 100644 --- a/noncore/games/kbill/UI.cpp +++ b/noncore/games/kbill/UI.cpp @@ -73,5 +73,5 @@ void UI::popup_dialog (int dialog) { case Game::HIGHSCORE: - // QMessageBox::message(("HighScore"), highscorestr); break; - case Game::ENTERNAME: { + case Game::ENTERNAME: + { InputBox b(main, 0, ("Enter Name"), QT_TR_NOOP(enternamestr)); @@ -79,3 +79,3 @@ void UI::popup_dialog (int dialog) { char str[20], *nl; - strcpy(str, b.getText()); + strncpy(str, b.getText(), 19); if (!str[0] || state) @@ -84,5 +84,4 @@ void UI::popup_dialog (int dialog) { *nl = '\0'; - if (strlen(str) > 20) - str[20] = 0; /* truncate string if too long */ -// scores.recalc(str); + if (strlen(str) > 19) + str[19] = '\0'; /* truncate/terminate the string if it is too long */ } |