Little bastards keep popping up here and there :(

This commit is contained in:
Mike Gelfand 2017-05-23 22:17:17 +03:00
parent 501be27972
commit 295d3359b2
2 changed files with 3 additions and 3 deletions

View 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;

View 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));