[Scummvm-cvs-logs] CVS: scummvm/sky control.cpp,1.92,1.93

Jonathan Gray khalek at users.sourceforge.net
Fri Apr 8 18:53:17 CEST 2005


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26313/sky

Modified Files:
	control.cpp 
Log Message:
Remove usage of vsprintf in favour of vsnprintf and make
more use of STRINGBUFLEN.  Some ports may need a new stub for
this, discussed with Chrilith.


Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- control.cpp	1 Apr 2005 07:30:25 -0000	1.92
+++ control.cpp	9 Apr 2005 01:52:43 -0000	1.93
@@ -1053,15 +1053,11 @@
 }
 
 int Control::displayMessage(const char *altButton, const char *message, ...) {
-#ifdef __PALM_OS__
-	char buf[256]; // 1024 is too big overflow the stack
-#else
-	char buf[1024];
-#endif
+	char buf[STRINGBUFLEN];
 	va_list va;
 
 	va_start(va, message);
-	vsprintf(buf, message, va);
+	vsnprintf(buf, STRINGBUFLEN, message, va);
 	va_end(va);
 
 	GUI::MessageDialog dialog(buf, "OK", altButton);





More information about the Scummvm-git-logs mailing list