]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/headers.h
Fix all issues found by the Clang Static Analyzer.
[quix0rs-blobwars.git] / src / headers.h
index aea64aa7f8e079f5f7b39e537847002548f5591e..a79edb2cf27d0bb70fc5715fc669cb892b98d886 100644 (file)
@@ -57,8 +57,8 @@ extern DECLSPEC int SDLCALL SDL_GetGamma(float *red, float *green, float *blue);
 #endif
 
 #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)
+static inline void strlcat(char *dest, const char *src, size_t n) { strncat(dest, src, n - 1); }
+static inline void strlcpy(char *dest, const char *src, size_t n) { strncpy(dest, src, n); dest[n - 1] = 0; }
 #endif
 
 #include "defs.h"