From 21ce4ddb65db6210137b30b607a805a40bc53fe6 Mon Sep 17 00:00:00 2001 From: brodsom Date: Wed, 9 Apr 2003 11:41:26 +0000 Subject: [PATCH] Patch wrong condition in loop --- src/jrd/sort_mem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jrd/sort_mem.cpp b/src/jrd/sort_mem.cpp index 1269f62c7c..ec2f0f70af 100644 --- a/src/jrd/sort_mem.cpp +++ b/src/jrd/sort_mem.cpp @@ -293,7 +293,7 @@ size_t SortMem::read(STATUS *status, size_t position, char *address, size_t leng assert(block); // Read data from as many blocks as necessary - for (Block *itr = block; itr, length > 0; itr = itr->next, pos = 0) + for (Block *itr = block; itr && length > 0; itr = itr->next, pos = 0) { size_t n = itr->read(status, pos, address, length); address += n; @@ -333,7 +333,7 @@ size_t SortMem::write(STATUS *status, size_t position, char *address, size_t len assert(block); // Write data to as many blocks as necessary - for (Block *itr = block; itr, length > 0; itr = itr->next, pos = 0) + for (Block *itr = block; itr && length > 0; itr = itr->next, pos = 0) { size_t n = itr->write(status, pos, address, length); address += n;