aboutsummaryrefslogtreecommitdiffstats
path: root/libdevcore/UTF8.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-08-09 02:12:52 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-08-09 03:05:31 +0800
commitf1df3dee537e827bc4f74ed92ab8a58cd4cf2ac0 (patch)
treef2a8c4b580a38cf372d607d97e3d355742f28ce2 /libdevcore/UTF8.cpp
parentc1571634413fe7de3140b7fdbf55b1d884ef03ff (diff)
downloaddexon-solidity-f1df3dee537e827bc4f74ed92ab8a58cd4cf2ac0.tar.gz
dexon-solidity-f1df3dee537e827bc4f74ed92ab8a58cd4cf2ac0.tar.zst
dexon-solidity-f1df3dee537e827bc4f74ed92ab8a58cd4cf2ac0.zip
Use size_t in dev::utf8::validate()
Diffstat (limited to 'libdevcore/UTF8.cpp')
-rw-r--r--libdevcore/UTF8.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libdevcore/UTF8.cpp b/libdevcore/UTF8.cpp
index 0c385e81..a71693a8 100644
--- a/libdevcore/UTF8.cpp
+++ b/libdevcore/UTF8.cpp
@@ -31,18 +31,18 @@ namespace utf8
{
-bool validate(std::string const& _input, int& _invalidPosition)
+bool validate(std::string const& _input, size_t& _invalidPosition)
{
- const int length = _input.length();
+ const size_t length = _input.length();
bool valid = true;
- int i = 0;
+ size_t i = 0;
for (; i < length; i++)
{
if ((unsigned char)_input[i] < 0x80)
continue;
- int count = 0;
+ size_t count = 0;
switch(_input[i] & 0xe0) {
case 0xc0: count = 1; break;
case 0xe0: count = 2; break;
@@ -62,7 +62,7 @@ bool validate(std::string const& _input, int& _invalidPosition)
break;
}
- for (int j = 0; j < count; j++)
+ for (size_t j = 0; j < count; j++)
{
i++;
if ((_input[i] & 0xc0) != 0x80)