diff src/video/Xext/extensions/extutil.h @ 1379:c0a74f199ecf

Use only safe string functions
author Sam Lantinga <slouken@libsdl.org>
date Sun, 19 Feb 2006 23:46:34 +0000
parents 045f186426e1
children 3ba88cb7eb1b
line wrap: on
line diff
--- a/src/video/Xext/extensions/extutil.h	Sun Feb 19 23:38:57 2006 +0000
+++ b/src/video/Xext/extensions/extutil.h	Sun Feb 19 23:46:34 2006 +0000
@@ -36,6 +36,8 @@
 #ifndef _EXTUTIL_H_
 #define _EXTUTIL_H_
 
+#include "SDL_stdinc.h"		/* For portable string functions */
+
 #include <X11/extensions/Xext.h>
 
 /*
@@ -212,7 +214,7 @@
     code -= codes->first_error;  \
     if (code >= 0 && code < nerr) { \
 	char tmp[256]; \
-	sprintf (tmp, "%s.%d", extname, code); \
+	SDL_snprintf (tmp, SDL_arraysize(tmp), "%s.%d", extname, code); \
 	pXGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
 	return buf; \
     } \