Skip to content

Commit

Permalink
Unsigned comparison corrected (fixes cpputest#1231).
Browse files Browse the repository at this point in the history
  • Loading branch information
offa committed Nov 27, 2019
1 parent f00191b commit f1e4a94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/CppUTest/MemoryLeakDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ void SimpleStringBuffer::clear()
void SimpleStringBuffer::add(const char* format, ...)
{
int count = 0;
size_t positions_left = write_limit_ - positions_filled_;
if (positions_left <= 0) return;
const size_t positions_left = write_limit_ - positions_filled_;
if (positions_left == 0) return;

va_list arguments;
va_start(arguments, format);
Expand All @@ -65,7 +65,7 @@ void SimpleStringBuffer::addMemoryDump(const void* memory, size_t memorySize)
const unsigned char* byteMemory = (const unsigned char*)memory;
const size_t maxLineBytes = 16;
size_t currentPos = 0;
size_t p;
size_t p;

while (currentPos < memorySize) {
add(" %04lx: ", (unsigned long) currentPos);
Expand Down

0 comments on commit f1e4a94

Please sign in to comment.