libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 9998ca76905bb3b922c147281e13f4718bf72fe3
parent 78a903946d707cab78c5eb996312deccb3f68c82
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Fri, 19 Apr 2019 12:27:43 +0300

sha256.c: convert to Yoda conditions

Diffstat:
Msrc/microhttpd/sha256.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/microhttpd/sha256.c b/src/microhttpd/sha256.c @@ -258,7 +258,7 @@ sha256_update (void *ctx_, bytes_have = (unsigned)(ctx->count & (SHA256_BLOCK_SIZE-1)); ctx->count += length; - if (bytes_have) + if (0 != bytes_have) { unsigned bytes_left = SHA256_BLOCK_SIZE - bytes_have; if (length >= bytes_left) @@ -274,7 +274,7 @@ sha256_update (void *ctx_, } } - while (length >= SHA256_BLOCK_SIZE) + while (SHA256_BLOCK_SIZE <= length) { /* Process any full blocks of new data directly, without copying to buffer. */ sha256_transform (ctx->H, data); @@ -282,7 +282,7 @@ sha256_update (void *ctx_, length -= SHA256_BLOCK_SIZE; } - if (length != 0) + if (0 != length) { /* Copy incomplete block of new data (if any) to buffer. */ memcpy (ctx->buffer + bytes_have, data, length);