diff options
author | linnemannr <linnemannr@gmail.com> | 2015-05-30 10:23:57 +0200 |
---|---|---|
committer | linnemannr <linnemannr@gmail.com> | 2015-05-30 10:23:57 +0200 |
commit | ee34e7131a5a7a308fe431c44741d68a10bb2625 (patch) | |
tree | 8f72bc78944f08e0287bf9c782c8152a138a6489 /src/StringUtils.h | |
parent | Merge pull request #2166 from SafwatHalaby/squid (diff) | |
download | cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.gz cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.bz2 cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.lz cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.xz cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.zst cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.zip |
Diffstat (limited to '')
-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')) |