From: Junio C Hamano Date: Tue, 1 Nov 2005 18:56:03 +0000 (-0800) Subject: Fix constness of input in mozilla-sha1/sha1.c::SHA1_Update(). X-Git-Tag: v0.99.9b^2~10 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=77ab8798d3f8df39877235be17bb6e70077aaba2;p=git.git Fix constness of input in mozilla-sha1/sha1.c::SHA1_Update(). Among the three of our own implementations, only this one lacked "const" from the second argument. Signed-off-by: Junio C Hamano --- diff --git a/mozilla-sha1/sha1.c b/mozilla-sha1/sha1.c index 7f6fc05e..847531d1 100644 --- a/mozilla-sha1/sha1.c +++ b/mozilla-sha1/sha1.c @@ -56,8 +56,8 @@ void SHA1_Init(SHA_CTX *ctx) { } -void SHA1_Update(SHA_CTX *ctx, void *_dataIn, int len) { - unsigned char *dataIn = _dataIn; +void SHA1_Update(SHA_CTX *ctx, const void *_dataIn, int len) { + const unsigned char *dataIn = _dataIn; int i; /* Read the data into W and process blocks as they get full diff --git a/mozilla-sha1/sha1.h b/mozilla-sha1/sha1.h index f5decbf4..5d82afa3 100644 --- a/mozilla-sha1/sha1.h +++ b/mozilla-sha1/sha1.h @@ -41,5 +41,5 @@ typedef struct { } SHA_CTX; void SHA1_Init(SHA_CTX *ctx); -void SHA1_Update(SHA_CTX *ctx, void *dataIn, int len); +void SHA1_Update(SHA_CTX *ctx, const void *dataIn, int len); void SHA1_Final(unsigned char hashout[20], SHA_CTX *ctx);