diff options
Diffstat (limited to '')
-rw-r--r-- | src/string.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/string.h b/src/string.h index 9270c55..3ac161b 100644 --- a/src/string.h +++ b/src/string.h | |||
@@ -203,6 +203,7 @@ namespace Bu | |||
203 | if( *a != *b ) | 203 | if( *a != *b ) |
204 | return false; | 204 | return false; |
205 | } | 205 | } |
206 | |||
206 | return true; | 207 | return true; |
207 | } | 208 | } |
208 | 209 | ||
@@ -212,11 +213,14 @@ namespace Bu | |||
212 | const_iterator b = c; | 213 | const_iterator b = c; |
213 | if( a == b ) | 214 | if( a == b ) |
214 | return true; | 215 | return true; |
215 | for(int j = 0; a && b && j < nLen; a++, b++, j++ ) | 216 | int j; |
217 | for( j = 0; a && b && j < nLen; a++, b++, j++ ) | ||
216 | { | 218 | { |
217 | if( *a != *b ) | 219 | if( *a != *b ) |
218 | return false; | 220 | return false; |
219 | } | 221 | } |
222 | if( j < nLen ) | ||
223 | return false; | ||
220 | return true; | 224 | return true; |
221 | } | 225 | } |
222 | 226 | ||
@@ -252,7 +256,7 @@ namespace Bu | |||
252 | bool compare( const String &s ) const | 256 | bool compare( const String &s ) const |
253 | { | 257 | { |
254 | if( !pChunk ) return false; | 258 | if( !pChunk ) return false; |
255 | return compare( s.begin() ); | 259 | return compare( s.begin(), s.getSize() ); |
256 | } | 260 | } |
257 | 261 | ||
258 | bool compare( const String &s, int nLen ) const | 262 | bool compare( const String &s, int nLen ) const |
@@ -458,11 +462,14 @@ namespace Bu | |||
458 | iterator b = c; | 462 | iterator b = c; |
459 | if( a == b ) | 463 | if( a == b ) |
460 | return true; | 464 | return true; |
461 | for(int j = 0; a && b && j < nLen; a++, b++, j++ ) | 465 | int j; |
466 | for( j = 0; a && b && j < nLen; a++, b++, j++ ) | ||
462 | { | 467 | { |
463 | if( *a != *b ) | 468 | if( *a != *b ) |
464 | return false; | 469 | return false; |
465 | } | 470 | } |
471 | if( j < nLen ) | ||
472 | return false; | ||
466 | return true; | 473 | return true; |
467 | } | 474 | } |
468 | 475 | ||
@@ -498,7 +505,7 @@ namespace Bu | |||
498 | bool compare( const String &s ) const | 505 | bool compare( const String &s ) const |
499 | { | 506 | { |
500 | if( !pChunk ) return false; | 507 | if( !pChunk ) return false; |
501 | return compare( s.begin() ); | 508 | return compare( s.begin(), s.getSize() ); |
502 | } | 509 | } |
503 | 510 | ||
504 | bool compare( const String &s, int nLen ) const | 511 | bool compare( const String &s, int nLen ) const |