mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-06 07:43:35 +00:00
Use malloc rather than calloc
This commit is contained in:
parent
c4beee7681
commit
15760c598d
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user