summaryrefslogtreecommitdiffstats
path: root/src/StringUtils.h
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-19 12:50:59 +0200
committertycho <work.tycho@gmail.com>2015-05-19 12:50:59 +0200
commitf2689c4887e6bd66af34de81cd793322f1dd57c4 (patch)
treeb8b78c3f7715797a640dc77b4474e1d2fe347e0c /src/StringUtils.h
parentMerge branch 'master' of https://github.com/mc-server/MCServer (diff)
downloadcuberite-f2689c4887e6bd66af34de81cd793322f1dd57c4.tar
cuberite-f2689c4887e6bd66af34de81cd793322f1dd57c4.tar.gz
cuberite-f2689c4887e6bd66af34de81cd793322f1dd57c4.tar.bz2
cuberite-f2689c4887e6bd66af34de81cd793322f1dd57c4.tar.lz
cuberite-f2689c4887e6bd66af34de81cd793322f1dd57c4.tar.xz
cuberite-f2689c4887e6bd66af34de81cd793322f1dd57c4.tar.zst
cuberite-f2689c4887e6bd66af34de81cd793322f1dd57c4.zip
Diffstat (limited to 'src/StringUtils.h')
-rw-r--r--src/StringUtils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/StringUtils.h b/src/StringUtils.h
index b5fc58a2d..8f67d8031 100644
--- a/src/StringUtils.h
+++ b/src/StringUtils.h
@@ -158,7 +158,7 @@ bool StringToInteger(const AString & a_str, T & a_Num)
return false;
}
result *= 10;
- T digit = a_str[i] - '0';
+ T digit = static_cast<T>(a_str[i] - '0');
if (std::numeric_limits<T>::max() - digit < result)
{
return false;
@@ -179,7 +179,7 @@ bool StringToInteger(const AString & a_str, T & a_Num)
return false;
}
result *= 10;
- T digit = a_str[i] - '0';
+ T digit = static_cast<T>(a_str[i] - '0');
if (std::numeric_limits<T>::min() + digit > result)
{
return false;