]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_sdl.c
added a -I option on Mac OSX SDL builds to include the relevant Headers
[xonotic/darkplaces.git] / sys_sdl.c
index 5f3e6c6c5049920644bde787367efecd19dd55b1..72c5953a6429ea823ab58a88662bb1084a2fe323 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
@@ -1,3 +1,4 @@
+#include "quakedef.h"
 
 #ifdef WIN32
 #include <io.h>
@@ -10,8 +11,6 @@
 
 #include <signal.h>
 
-#include "quakedef.h"
-
 #include <SDL.h>
 
 // =======================================================================
@@ -155,11 +154,9 @@ char *Sys_ConsoleInput(void)
        return NULL;
 }
 
-void Sys_Sleep(int milliseconds)
+void Sys_Sleep(int microseconds)
 {
-       if (milliseconds < 1)
-               milliseconds = 1;
-       SDL_Delay(milliseconds);
+       SDL_Delay(microseconds / 1000);
 }
 
 char *Sys_GetClipboardData (void)
@@ -176,8 +173,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);
                        }
                }