Fix possible bufferoverflows
[lcr.git] / macro.h
diff --git a/macro.h b/macro.h
index fb070ba..29b2794 100644 (file)
--- a/macro.h
+++ b/macro.h
@@ -22,7 +22,7 @@ static inline void scpy(char *dst, const char *src, unsigned int siz)
 
 /* safe strcat/strncat */
 
-#define SCAT(dst, src) scat(dst, src, sizeof(dst))
+#define SCAT(dst, src) scat(dst, src, sizeof(dst)-strlen(dst)-1)
 static inline void scat(char *dst, const char *src, unsigned int siz)
 {
        strncat(dst, src, siz);