]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/headers.h
Use strlcat() and strlcpy(), #define wrappers when these functions are not available.
[quix0rs-blobwars.git] / src / headers.h
index f8501592b908d00e31eadb9302dc95579b755b3a..faf00088d3324e0852d7097939138a91a4921d80 100755 (executable)
@@ -45,6 +45,11 @@ extern DECLSPEC int SDLCALL SDL_GetGamma(float *red, float *green, float *blue);
 #include <libintl.h>
 #define _(string) gettext(string)
 
+#if !defined(OpenBSD) && !defined(FreeBSD)
+#define strlcat(dest, src, n) strncat((dest), (src), (n) - 1)
+#define strlcpy(dest, src, n) do {strncpy((dest), (src), (n)); (dest)[(n) - 1] = 0;} while(false)
+#endif
+
 #include "defs.h"
 
 #include "CMath.h"