aboutsummaryrefslogtreecommitdiff
path: root/builtin-tar-tree.c
diff options
context:
space:
mode:
authorPeter Eriksen <s022018@student.dtu.dk>2006-06-11 14:03:28 +0200
committerJunio C Hamano <junkio@cox.net>2006-06-16 22:45:12 -0700
commitbfbd0bb6ecbbbf75a5caaff6afaf5a6af8fa518e (patch)
tree52f36804599a41eafa3a020f06dbe118c6f652f9 /builtin-tar-tree.c
parent5996ca0836e21ab4e6be0a16a615eff965f18b8b (diff)
downloadgit-bfbd0bb6ecbbbf75a5caaff6afaf5a6af8fa518e.tar.gz
git-bfbd0bb6ecbbbf75a5caaff6afaf5a6af8fa518e.tar.xz
Implement safe_strncpy() as strlcpy() and use it more.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-tar-tree.c')
-rw-r--r--builtin-tar-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c
index 58a8ccd4d..f6310b903 100644
--- a/builtin-tar-tree.c
+++ b/builtin-tar-tree.c
@@ -240,8 +240,8 @@ static void write_entry(const unsigned char *sha1, struct strbuf *path,
/* XXX: should we provide more meaningful info here? */
sprintf(header.uid, "%07o", 0);
sprintf(header.gid, "%07o", 0);
- strncpy(header.uname, "git", 31);
- strncpy(header.gname, "git", 31);
+ safe_strncpy(header.uname, "git", sizeof(header.uname));
+ safe_strncpy(header.gname, "git", sizeof(header.gname));
sprintf(header.devmajor, "%07o", 0);
sprintf(header.devminor, "%07o", 0);