Mercurial > hg > nginx
diff src/core/ngx_md5.c @ 3927:38e6f45c5e3d
make built-in ngx_md5_update() interface consistent with other implemenations
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 27 May 2011 10:00:46 +0000 |
parents | 4d5754e2f220 |
children | ce1ba4a312d7 |
line wrap: on
line diff
--- a/src/core/ngx_md5.c +++ b/src/core/ngx_md5.c @@ -32,7 +32,7 @@ ngx_md5_init(ngx_md5_t *ctx) void -ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size) +ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size) { size_t used, free; @@ -47,8 +47,7 @@ ngx_md5_update(ngx_md5_t *ctx, const u_c return; } - ngx_memcpy(&ctx->buffer[used], data, free); - data = (u_char *)data + free; + data = ngx_cpymem(&ctx->buffer[used], data, free); size -= free; (void) ngx_md5_body(ctx, ctx->buffer, 64); }