Fix string_copy macro to use sizeof(src) for the source buffer
[tig] / tig.c
diff --git a/tig.c b/tig.c
index e918fe6..ba1ad3d 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -169,7 +169,7 @@ string_ncopy_do(char *dst, size_t dstlen, const char *src, size_t srclen)
 /* Shorthands for safely copying into a fixed buffer. */
 
 #define string_copy(dst, src) \
-       string_ncopy_do(dst, sizeof(dst), src, sizeof(dst))
+       string_ncopy_do(dst, sizeof(dst), src, sizeof(src))
 
 #define string_ncopy(dst, src, srclen) \
        string_ncopy_do(dst, sizeof(dst), src, srclen)