aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-02-03 13:50:50 -0800
committerGuy Harris <guy@alum.mit.edu>2016-02-03 21:51:30 +0000
commitee864219ff46c65c12df607364dcfc5b4a8710bd (patch)
tree2a3a9fc23e772eeed6ea1e3070f6abf9c0c44177
parent2079e5da30f4111ec9c0f7e6068d7fd25b7cefe3 (diff)
Squelch warnings from compilers that don't know that (a%b) is always < b.
Change-Id: I71efc87ad6931e5bbac0cbc0f5602eb7101fde54 Reviewed-on: https://code.wireshark.org/review/13699 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--wsutil/sha2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wsutil/sha2.c b/wsutil/sha2.c
index a5694c4ed7..2466d7d4f6 100644
--- a/wsutil/sha2.c
+++ b/wsutil/sha2.c
@@ -147,7 +147,7 @@ void sha256_update( sha256_context *ctx, const guint8 *input, guint32 length )
if( ! length ) return;
- left = ctx->total % SHA256_BLOCK_SIZE;
+ left = (guint32)(ctx->total % SHA256_BLOCK_SIZE);
fill = SHA256_BLOCK_SIZE - left;
ctx->total += length;
@@ -192,7 +192,7 @@ void sha256_finish( sha256_context *ctx, guint8 digest[SHA256_DIGEST_LEN] )
total_length = ctx->total * 8;
- last = ctx->total % SHA256_BLOCK_SIZE;
+ last = (guint32)(ctx->total % SHA256_BLOCK_SIZE);
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
PUT_UINT32( total_length >> 32, msglen, 0 );