diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/stable/string.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stable/string.cpp b/src/stable/string.cpp index 3029584..ed7be27 100644 --- a/src/stable/string.cpp +++ b/src/stable/string.cpp | |||
@@ -967,18 +967,24 @@ Bu::String Bu::String::toUpper() const | |||
967 | int16_t Bu::String::toInt16( int iRadix ) const | 967 | int16_t Bu::String::toInt16( int iRadix ) const |
968 | { | 968 | { |
969 | flatten(); | 969 | flatten(); |
970 | if( core->pFirst == NULL || core->nLength == 0 ) | ||
971 | return 0; | ||
970 | return strtol( core->pFirst->pData, NULL, iRadix ); | 972 | return strtol( core->pFirst->pData, NULL, iRadix ); |
971 | } | 973 | } |
972 | 974 | ||
973 | int32_t Bu::String::toInt32( int iRadix ) const | 975 | int32_t Bu::String::toInt32( int iRadix ) const |
974 | { | 976 | { |
975 | flatten(); | 977 | flatten(); |
978 | if( core->pFirst == NULL || core->nLength == 0 ) | ||
979 | return 0; | ||
976 | return strtol( core->pFirst->pData, NULL, iRadix ); | 980 | return strtol( core->pFirst->pData, NULL, iRadix ); |
977 | } | 981 | } |
978 | 982 | ||
979 | int64_t Bu::String::toInt64( int iRadix ) const | 983 | int64_t Bu::String::toInt64( int iRadix ) const |
980 | { | 984 | { |
981 | flatten(); | 985 | flatten(); |
986 | if( core->pFirst == NULL || core->nLength == 0 ) | ||
987 | return 0; | ||
982 | return strtoll( core->pFirst->pData, NULL, iRadix ); | 988 | return strtoll( core->pFirst->pData, NULL, iRadix ); |
983 | } | 989 | } |
984 | 990 | ||