Skip to content

Commit fa32af2

Browse files
author
MarcoFalke
committed
Replace LocaleIndependentAtoi with ToIntegral
No need for saturating behavior when the int is composed of 3 digits.
1 parent faab76c commit fa32af2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/torcontrol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void TorControlConnection::readcb(struct bufferevent *bev, void *ctx)
9191
if (s.size() < 4) // Short line
9292
continue;
9393
// <status>(-|+| )<data><CRLF>
94-
self->message.code = LocaleIndependentAtoi<int>(s.substr(0,3));
94+
self->message.code = ToIntegral<int>(s.substr(0, 3)).value_or(0);
9595
self->message.lines.push_back(s.substr(4));
9696
char ch = s[3]; // '-','+' or ' '
9797
if (ch == ' ') {

0 commit comments

Comments
 (0)