From 9ba9afe834bcf76b89c011fedc464f61d9a45243 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 23 Feb 2001 00:20:53 +0000 Subject: [PATCH] fixed bug in string size test --- src/ca/nciu.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/ca/nciu.cpp b/src/ca/nciu.cpp index 3c353c72f..2ab36660e 100644 --- a/src/ca/nciu.cpp +++ b/src/ca/nciu.cpp @@ -67,8 +67,7 @@ nciu::nciu ( cac &cacIn, netiiu &iiuIn, cacChannelNotify &chanIn, void nciu::destroy () { - // this occurs here so that it happens when - // a lock is not applied + // care is taken so that a lock is not applied during this phase unsigned i = 0u; while ( ! this->piiu->destroyAllIO ( *this ) ) { if ( i++ > 1000u ) { @@ -155,14 +154,10 @@ LOCAL int check_a_dbr_string ( const char *pStr, const unsigned count ) for ( i = 0; i < count; i++ ) { unsigned int strsize = 0; - while ( 1 ) { - if (strsize >= MAX_STRING_SIZE ) { + while ( pStr[strsize++] != '\0' ) { + if ( strsize >= MAX_STRING_SIZE ) { return ECA_STRTOBIG; } - if ( pStr[strsize] == '\0' ) { - break; - } - strsize++; } pStr += MAX_STRING_SIZE; }