mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
Replace LocaleIndependentAtoi with ToIntegral
No need for saturating behavior when the int is composed of 3 digits.
This commit is contained in:
@@ -91,7 +91,7 @@ void TorControlConnection::readcb(struct bufferevent *bev, void *ctx)
|
|||||||
if (s.size() < 4) // Short line
|
if (s.size() < 4) // Short line
|
||||||
continue;
|
continue;
|
||||||
// <status>(-|+| )<data><CRLF>
|
// <status>(-|+| )<data><CRLF>
|
||||||
self->message.code = LocaleIndependentAtoi<int>(s.substr(0,3));
|
self->message.code = ToIntegral<int>(s.substr(0, 3)).value_or(0);
|
||||||
self->message.lines.push_back(s.substr(4));
|
self->message.lines.push_back(s.substr(4));
|
||||||
char ch = s[3]; // '-','+' or ' '
|
char ch = s[3]; // '-','+' or ' '
|
||||||
if (ch == ' ') {
|
if (ch == ' ') {
|
||||||
|
|||||||
Reference in New Issue
Block a user