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:
Peter Eriksen
2006-06-11 14:03:28 +02:00
committed by Junio C Hamano
parent 5996ca0836
commit bfbd0bb6ec
9 changed files with 28 additions and 27 deletions

View File

@ -112,7 +112,7 @@ static void reopen_stdout(struct commit *commit, int nr, int keep_subject)
int len = 0;
if (output_directory) {
strncpy(filename, output_directory, 1010);
safe_strncpy(filename, output_directory, 1010);
len = strlen(filename);
if (filename[len - 1] != '/')
filename[len++] = '/';