diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-25 21:27:56 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-25 21:27:56 -0400 |
commit | 9dadaebfeb461ba795124281018d0f7eac200cf4 (patch) | |
tree | 941243868b1dcacd68cbd52a2f96e40bf70a5d3b /src/commodity.cc | |
parent | f35bc939c96c3a3bf09c5881d638b5ba60449c03 (diff) | |
parent | e696bfd913a10edd19f9e35eb1aee2c97b11e7f6 (diff) | |
download | fork-ledger-9dadaebfeb461ba795124281018d0f7eac200cf4.tar.gz fork-ledger-9dadaebfeb461ba795124281018d0f7eac200cf4.tar.bz2 fork-ledger-9dadaebfeb461ba795124281018d0f7eac200cf4.zip |
Merge branch 'next'
Diffstat (limited to 'src/commodity.cc')
-rw-r--r-- | src/commodity.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index 37f0b573..4041946b 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -498,10 +498,9 @@ void commodity_t::parse_symbol(std::istream& in, string& symbol) char * _p = buf; c = static_cast<char>(in.peek()); while (_p - buf < 255 && in.good() && ! in.eof() && c != '\n') { - int bytes = 0; - int size = _p - buf; - - unsigned char d = c; + std::size_t bytes = 0; + std::ptrdiff_t size = _p - buf; + unsigned char d = c; // Check for the start of a UTF-8 multi-byte encoded string if (d >= 192 && d <= 223 && size < 254) @@ -518,7 +517,7 @@ void commodity_t::parse_symbol(std::istream& in, string& symbol) break; if (bytes > 0) { // we're looking at a UTF-8 encoding - for (int i = 0; i < bytes; i++) { + for (std::size_t i = 0; i < bytes; i++) { in.get(c); if (in.bad() || in.eof()) break; |