aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/sha256.c
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2019-04-19 12:27:43 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2019-04-19 12:27:43 +0300
commit9998ca76905bb3b922c147281e13f4718bf72fe3 (patch)
tree58d7de1ffe466d963350f48d08cb72ddf6190bce /src/microhttpd/sha256.c
parent78a903946d707cab78c5eb996312deccb3f68c82 (diff)
downloadlibmicrohttpd-9998ca76905bb3b922c147281e13f4718bf72fe3.tar.gz
libmicrohttpd-9998ca76905bb3b922c147281e13f4718bf72fe3.zip
sha256.c: convert to Yoda conditions
Diffstat (limited to 'src/microhttpd/sha256.c')
-rw-r--r--src/microhttpd/sha256.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/microhttpd/sha256.c b/src/microhttpd/sha256.c
index e3989d57..801f920b 100644
--- a/src/microhttpd/sha256.c
+++ b/src/microhttpd/sha256.c
@@ -258,7 +258,7 @@ sha256_update (void *ctx_,
258 bytes_have = (unsigned)(ctx->count & (SHA256_BLOCK_SIZE-1)); 258 bytes_have = (unsigned)(ctx->count & (SHA256_BLOCK_SIZE-1));
259 ctx->count += length; 259 ctx->count += length;
260 260
261 if (bytes_have) 261 if (0 != bytes_have)
262 { 262 {
263 unsigned bytes_left = SHA256_BLOCK_SIZE - bytes_have; 263 unsigned bytes_left = SHA256_BLOCK_SIZE - bytes_have;
264 if (length >= bytes_left) 264 if (length >= bytes_left)
@@ -274,7 +274,7 @@ sha256_update (void *ctx_,
274 } 274 }
275 } 275 }
276 276
277 while (length >= SHA256_BLOCK_SIZE) 277 while (SHA256_BLOCK_SIZE <= length)
278 { /* Process any full blocks of new data directly, 278 { /* Process any full blocks of new data directly,
279 without copying to buffer. */ 279 without copying to buffer. */
280 sha256_transform (ctx->H, data); 280 sha256_transform (ctx->H, data);
@@ -282,7 +282,7 @@ sha256_update (void *ctx_,
282 length -= SHA256_BLOCK_SIZE; 282 length -= SHA256_BLOCK_SIZE;
283 } 283 }
284 284
285 if (length != 0) 285 if (0 != length)
286 { /* Copy incomplete block of new data (if any) 286 { /* Copy incomplete block of new data (if any)
287 to buffer. */ 287 to buffer. */
288 memcpy (ctx->buffer + bytes_have, data, length); 288 memcpy (ctx->buffer + bytes_have, data, length);