author | Daniel Barkalow <barkalow@iabervon.org> | |
Thu, 3 May 2007 02:49:41 +0000 (22:49 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 4 May 2007 05:28:55 +0000 (22:28 -0700) | ||
commit | 5094102e13640d7559a02fd7c77b44dc9254cbbb | |
tree | c1d19c522edf8c5e4a5eb49442509d937b02c995 | tree | snapshot |
parent | cdda666201710dcf50d7ebee804aac65fdec32fd | commit | diff |
Make xstrndup common
This also improves the implementation to match how strndup is
specified (by GNU): if the length given is longer than the string,
only the string's length is allocated and copied, but the string need
not be null-terminated if it is at least as long as the given length.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This also improves the implementation to match how strndup is
specified (by GNU): if the length given is longer than the string,
only the string's length is allocated and copied, but the string need
not be null-terminated if it is at least as long as the given length.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
commit.c | diff | blob | history | |
git-compat-util.h | diff | blob | history |