]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_win.c
patch from div0 that enables printf format warnings in gcc
[xonotic/darkplaces.git] / sys_win.c
index 27041f6d6a5d712080557fa0a711df6ff789e8c6..6addcdfa5fb747c2c3e23b35fe693e7b3ddf2445 100644 (file)
--- a/sys_win.c
+++ b/sys_win.c
@@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "conproc.h"
 #include "direct.h"
 
-extern void S_BlockSound (void);
-
 cvar_t sys_usetimegettime = {CVAR_SAVE, "sys_usetimegettime", "1", "use windows timeGetTime function (which has issues on some motherboards) for timing rather than QueryPerformanceCounter timer (which has issues on multicore/multiprocessor machines and processors which are designed to conserve power)"};
 
 HANDLE                         hinput, houtput;
@@ -287,8 +285,10 @@ char *Sys_GetClipboardData (void)
                {
                        if ((cliptext = GlobalLock (hClipboardData)) != 0)
                        {
-                               data = Z_Malloc (GlobalSize(hClipboardData)+1);
-                               strcpy (data, cliptext);
+                               size_t allocsize;
+                               allocsize = GlobalSize (hClipboardData) + 1;
+                               data = Z_Malloc (allocsize);
+                               strlcpy (data, cliptext, allocsize);
                                GlobalUnlock (hClipboardData);
                        }
                }