Commit 590ff981 by Edward Thomson

oid: don't assume the size of an oid

Don't assume that a `git_oid` is a particular size; allocate
`sizeof(git_oid)` instead.
parent ab042161
......@@ -1830,7 +1830,7 @@ static int update_one_tip(
}
if (error == GIT_ENOTFOUND) {
memset(&old, 0, GIT_OID_RAWSZ);
memset(&old, 0, sizeof(git_oid));
error = 0;
if (autotag && (error = git_vector_insert(update_heads, head)) < 0)
......
......@@ -68,7 +68,7 @@ static void seed_packbuilder(void)
cl_git_pass(git_revwalk_push_ref(_revwalker, "HEAD"));
while (git_revwalk_next(&oid, _revwalker) == 0) {
o = git__malloc(GIT_OID_RAWSZ);
o = git__malloc(sizeof(git_oid));
cl_assert(o != NULL);
git_oid_cpy(o, &oid);
cl_git_pass(git_vector_insert(&_commits, o));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment