diff options
-rw-r--r-- | src/fbasicstring.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fbasicstring.h b/src/fbasicstring.h index 57e798e..6a1708d 100644 --- a/src/fbasicstring.h +++ b/src/fbasicstring.h | |||
@@ -1336,6 +1336,8 @@ namespace Bu | |||
1336 | */ | 1336 | */ |
1337 | chr &operator[]( long nIndex ) | 1337 | chr &operator[]( long nIndex ) |
1338 | { | 1338 | { |
1339 | if( nIndex < 0 || nIndex >= nLength ) | ||
1340 | throw Bu::ExceptionBase("Index out of range."); | ||
1339 | flatten(); | 1341 | flatten(); |
1340 | 1342 | ||
1341 | return pFirst->pData[nIndex]; | 1343 | return pFirst->pData[nIndex]; |
@@ -1348,6 +1350,8 @@ namespace Bu | |||
1348 | */ | 1350 | */ |
1349 | const chr &operator[]( long nIndex ) const | 1351 | const chr &operator[]( long nIndex ) const |
1350 | { | 1352 | { |
1353 | if( nIndex < 0 || nIndex >= nLength ) | ||
1354 | throw Bu::ExceptionBase("Index out of range."); | ||
1351 | flatten(); | 1355 | flatten(); |
1352 | 1356 | ||
1353 | return pFirst->pData[nIndex]; | 1357 | return pFirst->pData[nIndex]; |