]> granicus.if.org Git - transmission/commitdiff
Little bastards keep popping up here and there :(
authorMike Gelfand <mikedld@mikedld.com>
Tue, 23 May 2017 19:17:17 +0000 (22:17 +0300)
committerMike Gelfand <mikedld@mikedld.com>
Tue, 23 May 2017 19:17:17 +0000 (22:17 +0300)
libtransmission/inout.c
libtransmission/json-test.c

index afa2c975b4f02acc179dbb0b863ff7a0b229d7af..455b1fc8b89a26acd3ea6c42ba547eded4e68a5d 100644 (file)
@@ -200,7 +200,7 @@ static int readOrWritePiece(tr_torrent* tor, int ioMode, tr_piece_index_t pieceI
 
     tr_ioFindFileLocation(tor, pieceIndex, pieceOffset, &fileIndex, &fileOffset);
 
-    while (buflen && !err)
+    while (buflen != 0 && err == 0)
     {
         tr_file const* file = &info->files[fileIndex];
         uint64_t const bytesThisPass = MIN(buflen, file->length - fileOffset);
@@ -261,7 +261,7 @@ static bool recalculateHash(tr_torrent* tor, tr_piece_index_t pieceIndex, uint8_
 
     tr_ioPrefetch(tor, pieceIndex, offset, bytesLeft);
 
-    while (bytesLeft)
+    while (bytesLeft != 0)
     {
         size_t const len = MIN(bytesLeft, buflen);
         success = tr_cacheReadBlock(tor->session->cache, tor, pieceIndex, offset, len, buffer) == 0;
index 693d1f2befc17579a6b5d51b32c2b0f803e11371..0637dc540d4217a040c07ac0b7301552fb2f5ccd 100644 (file)
@@ -121,7 +121,7 @@ static int test_utf8(void)
         tr_variantFree(&top);
     }
 
-    check(json);
+    check(json != NULL);
     check(strstr(json, "\\u00f6") != NULL);
     check(strstr(json, "\\u00e9") != NULL);
     err = tr_variantFromJson(&top, json, strlen(json));