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>
This commit is contained in:

committed by
Junio C Hamano

parent
5996ca0836
commit
bfbd0bb6ec
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user