diff options
Diffstat (limited to 'src/StringUtils.h')
-rw-r--r-- | src/StringUtils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/StringUtils.h b/src/StringUtils.h index 8f67d8031..62767d007 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -168,6 +168,12 @@ bool StringToInteger(const AString & a_str, T & a_Num) } else { + // Unsigned result cannot be signed! + if (!std::numeric_limits<T>::is_signed) + { + return false; + } + for (size_t size = a_str.size(); i < size; i++) { if ((a_str[i] < '0') || (a_str[i] > '9')) |