aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2007-05-02 22:49:41 -0400
committerJunio C Hamano <junkio@cox.net>2007-05-03 22:28:55 -0700
commit5094102e13640d7559a02fd7c77b44dc9254cbbb (patch)
treec1d19c522edf8c5e4a5eb49442509d937b02c995 /commit.c
parentcdda666201710dcf50d7ebee804aac65fdec32fd (diff)
downloadgit-5094102e13640d7559a02fd7c77b44dc9254cbbb.tar.gz
git-5094102e13640d7559a02fd7c77b44dc9254cbbb.tar.xz
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>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/commit.c b/commit.c
index 754d1b8a0..eb911f44d 100644
--- a/commit.c
+++ b/commit.c
@@ -720,14 +720,6 @@ static char *logmsg_reencode(const struct commit *commit,
return out;
}
-static char *xstrndup(const char *text, int len)
-{
- char *result = xmalloc(len + 1);
- memcpy(result, text, len);
- result[len] = '\0';
- return result;
-}
-
static void fill_person(struct interp *table, const char *msg, int len)
{
int start, end, tz = 0;