]> granicus.if.org Git - nethack/commitdiff
Remove null characters from Qt y/n prompt
authorRay Chason <Ray Chason>
Mon, 24 Oct 2022 02:10:20 +0000 (22:10 -0400)
committerPatR <rankin@nethack.org>
Tue, 25 Oct 2022 22:20:19 +0000 (15:20 -0700)
Fixes issue #566.

win/Qt/qt_bind.cpp

index d75e32dc896eb90309f625b330818c17f257e76b..34a78cdb1aa6b6460bdd315c78ca9e1e1eea4adc 100644 (file)
@@ -703,7 +703,7 @@ char NetHackQtBind::qt_yn_function(const char *question_,
     int result = -1;
 
     if (choices) {
-        QString choicebuf((int) strlen(choices) + 1, QChar('\0'));
+        QString choicebuf;
         for (const char *p = choices; *p; ++p) {
             if (*p == '\033') // <esc> and anything beyond is hidden
                 break;