diff options
author | Mattes D <github@xoft.cz> | 2014-12-05 16:59:11 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-12-05 16:59:11 +0100 |
commit | e2a04f580a0813206f527a61244cb3382248fd12 (patch) | |
tree | 39f0a5026d619e89ce353cf8addf18e4a696b067 /src/StringUtils.cpp | |
parent | CheckBasicStyle: Added a check for parentheses around comparisons. (diff) | |
download | cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.gz cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.bz2 cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.lz cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.xz cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.zst cuberite-e2a04f580a0813206f527a61244cb3382248fd12.zip |
Diffstat (limited to 'src/StringUtils.cpp')
-rw-r--r-- | src/StringUtils.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index fe145521f..5febf5d6c 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -420,7 +420,10 @@ static bool isLegalUTF8(const unsigned char * source, int length) case 3: if (((a = (*--srcptr)) < 0x80) || (a > 0xbf)) return false; case 2: { - if ((a = (*--srcptr)) > 0xbf) return false; + if ((a = (*--srcptr)) > 0xbf) + { + return false; + } switch (*source) { // no fall-through in this inner switch @@ -523,7 +526,10 @@ are equivalent to the following loop: { ch += *source++; --tmpBytesToRead; - if (tmpBytesToRead) ch <<= 6; + if (tmpBytesToRead) + { + ch <<= 6; + } } while (tmpBytesToRead > 0); } --------------------------------------------------------------------- |