Adding negotiation of speech codecs between GSM and SIP when using rtp-bridge
[lcr.git] / macro.h
diff --git a/macro.h b/macro.h
index 5d2bce5..e4a2f2e 100644 (file)
--- a/macro.h
+++ b/macro.h
@@ -22,10 +22,10 @@ static inline void scpy(char *dst, const char *src, unsigned int siz)
 
 /* safe strcat/strncat */
 
-#define SCAT(dst, src) scat(dst, src, sizeof(dst)-strlen(dst)-1)
+#define SCAT(dst, src) scat(dst, src, sizeof(dst))
 static inline void scat(char *dst, const char *src, unsigned int siz)
 {
-       strncat(dst, src, siz);
+       strncat(dst, src, siz-strlen(dst)-1);
        dst[siz-1] = '\0';
 }