diff options
-rw-r--r-- | lib/String.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/String.cc b/lib/String.cc index 7300365..47315b6 100644 --- a/lib/String.cc +++ b/lib/String.cc @@ -388,9 +388,10 @@ const char & String::operator[](size_t i) const { } char & String::operator[](size_t i) throw (GeneralException) { - + static char zero; if (i >= siz) { - throw GeneralException("operator[] on String out of bounds"); + zero = 0; + return zero; } else { return str[i]; } |