diff options
author | vng <viktor.govako@gmail.com> | 2012-10-04 23:16:01 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:44:37 +0300 |
commit | 1f008f1b0e3bf6a6510cbc0dd5033e7249a4cabd (patch) | |
tree | d3642d6dc1b4a4cb7e1a7576eb344a6c239ba191 /coding/value_opt_string.hpp | |
parent | 3c802db64e08cf380829c38328c4cef5dea3ccb0 (diff) |
Fixed bug with very long house number (Try Colombia for example).
Diffstat (limited to 'coding/value_opt_string.hpp')
-rw-r--r-- | coding/value_opt_string.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/coding/value_opt_string.hpp b/coding/value_opt_string.hpp index 4e55745155..8ccf9c7f3c 100644 --- a/coding/value_opt_string.hpp +++ b/coding/value_opt_string.hpp @@ -42,9 +42,9 @@ public: template <class TSink> void Write(TSink & sink) const { - int n; - if (strings::to_int(m_s, n) && n >= 0) - WriteVarUint(sink, static_cast<uint32_t>((n << 1) | numeric_bit)); + uint64_t n; + if (strings::to_uint64(m_s, n) && ((n << 1) >> 1) == n) + WriteVarUint(sink, ((n << 1) | numeric_bit)); else { size_t const sz = m_s.size(); |