Code

git-config.txt: fix a typo
[git.git] / path.c
diff --git a/path.c b/path.c
index 092ce57190cc75882a3766c9aee1df719da8a3d6..a074aea64921eb1fb90f079ede9087e6b8109f6a 100644 (file)
--- a/path.c
+++ b/path.c
@@ -41,7 +41,7 @@ char *mksnpath(char *buf, size_t n, const char *fmt, ...)
        len = vsnprintf(buf, n, fmt, args);
        va_end(args);
        if (len >= n) {
-               snprintf(buf, n, bad_path);
+               strlcpy(buf, bad_path, n);
                return buf;
        }
        return cleanup_path(buf);
@@ -63,7 +63,7 @@ static char *git_vsnpath(char *buf, size_t n, const char *fmt, va_list args)
                goto bad;
        return cleanup_path(buf);
 bad:
-       snprintf(buf, n, bad_path);
+       strlcpy(buf, bad_path, n);
        return buf;
 }
 
@@ -402,7 +402,7 @@ int normalize_absolute_path(char *buf, const char *path)
                        goto next;
                }
 
-               memcpy(dst, comp_start, comp_len);
+               memmove(dst, comp_start, comp_len);
                dst += comp_len;
        next:
                comp_start = comp_end;