From fa32af22b323e7c58b6b20af6517f4795a72cdc5 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 8 Aug 2023 15:09:32 +0200 Subject: [PATCH] Replace LocaleIndependentAtoi with ToIntegral No need for saturating behavior when the int is composed of 3 digits. --- src/torcontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp index 5aaf52f5761..9cf976a7006 100644 --- a/src/torcontrol.cpp +++ b/src/torcontrol.cpp @@ -91,7 +91,7 @@ void TorControlConnection::readcb(struct bufferevent *bev, void *ctx) if (s.size() < 4) // Short line continue; // (-|+| ) - self->message.code = LocaleIndependentAtoi(s.substr(0,3)); + self->message.code = ToIntegral(s.substr(0, 3)).value_or(0); self->message.lines.push_back(s.substr(4)); char ch = s[3]; // '-','+' or ' ' if (ch == ' ') {