aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/UserDialog.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-05-23 12:21:21 +0000
committerPierre Ossman <ossman@cendio.se>2011-05-23 12:21:21 +0000
commitc628ba44c1a98cdee6580587bc50380b6cbc46e2 (patch)
tree9aa1b58bf0b1831218e77480a64909593ee38034 /vncviewer/UserDialog.cxx
parentbf1f26417247c2b9c794b3a25507a5a20107deab (diff)
downloadtigervnc-c628ba44c1a98cdee6580587bc50380b6cbc46e2.tar.gz
tigervnc-c628ba44c1a98cdee6580587bc50380b6cbc46e2.zip
We need to be careful about feeding FLTK @:s when they will be used in a
label as that is a formatting character. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4440 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/UserDialog.cxx')
-rw-r--r--vncviewer/UserDialog.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx
index e94ab71f..0ac5009a 100644
--- a/vncviewer/UserDialog.cxx
+++ b/vncviewer/UserDialog.cxx
@@ -34,6 +34,7 @@
#include <rfb/Exception.h>
#include "i18n.h"
+#include "fltk_layout.h"
#include "parameters.h"
#include "UserDialog.h"
@@ -137,6 +138,11 @@ void UserDialog::getUserPasswd(char** user, char** password)
bool UserDialog::showMsgBox(int flags, const char* title, const char* text)
{
+ char buffer[1024];
+
+ if (fltk_escape(text, buffer, sizeof(buffer)) >= sizeof(buffer))
+ return 0;
+
// FLTK doesn't give us a flexible choice of the icon, so we ignore those
// bits for now.
@@ -146,16 +152,16 @@ bool UserDialog::showMsgBox(int flags, const char* title, const char* text)
switch (flags & 0xf) {
case M_OKCANCEL:
- return fl_choice(text, NULL, fl_ok, fl_cancel) == 1;
+ return fl_choice(buffer, NULL, fl_ok, fl_cancel) == 1;
case M_YESNO:
- return fl_choice(text, NULL, fl_yes, fl_no) == 1;
+ return fl_choice(buffer, NULL, fl_yes, fl_no) == 1;
case M_OK:
default:
if (((flags & 0xf0) == M_ICONERROR) ||
((flags & 0xf0) == M_ICONWARNING))
- fl_alert(text);
+ fl_alert(buffer);
else
- fl_message(text);
+ fl_message(buffer);
return true;
}