mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-07 07:30:27 +00:00
sha1dc: SHA1DCUpdate
now takes a size_t
This commit is contained in:
parent
c9efa995e4
commit
d672963535
@ -28,18 +28,8 @@ GIT_INLINE(int) git_hash_init(git_hash_ctx *ctx)
|
|||||||
|
|
||||||
GIT_INLINE(int) git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
|
GIT_INLINE(int) git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
|
||||||
{
|
{
|
||||||
const char *p = data;
|
|
||||||
|
|
||||||
assert(ctx);
|
assert(ctx);
|
||||||
|
SHA1DCUpdate(&ctx->c, data, len);
|
||||||
/* We expect a size_t, but sha1dc only takes an int */
|
|
||||||
while (len > INT_MAX) {
|
|
||||||
SHA1DCUpdate(&ctx->c, p, INT_MAX);
|
|
||||||
p += INT_MAX;
|
|
||||||
len -= INT_MAX;
|
|
||||||
}
|
|
||||||
|
|
||||||
SHA1DCUpdate(&ctx->c, p, len);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user