summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-02-01 19:21:55 -0800
committerBen Straub <bs@github.com>2013-02-01 19:21:55 -0800
commit15760c598d57233820a68d2721643c637207a18e (patch)
tree4c50ae010dde2b10d39bf7f7cefd389b9b054b52 /src/util.h
parentc4beee768135f70b91b2c0bfa1dbc99a58c1f311 (diff)
downloadlibgit2-15760c598d57233820a68d2721643c637207a18e.tar.gz
Use malloc rather than calloc
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index e9edd84a3..351ff422b 100644
--- a/src/util.h
+++ b/src/util.h
@@ -64,8 +64,9 @@ GIT_INLINE(char *) git__strndup(const char *str, size_t n)
/* NOTE: This doesn't do null or '\0' checking. Watch those boundaries! */
GIT_INLINE(char *) git__substrdup(const char *start, size_t n)
{
- char *ptr = (char*)git__calloc(n+1, sizeof(char));
+ char *ptr = (char*)git__malloc(n+1);
memcpy(ptr, start, n);
+ ptr[n] = '\0';
return ptr;
}