Skip to content

Commit 2d64d2d

Browse files
authored
fix: Replace std:atoi with std:stoi (#8794)
1 parent c8e2f02 commit 2d64d2d

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/http_server.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,7 +2440,7 @@ HTTPAPIServer::GetContentLength(
24402440
evhtp_kv_find(req->headers_in, kContentLengthHeader);
24412441
if (content_length_c_str != nullptr) {
24422442
try {
2443-
lcontent_length = std::atoi(content_length_c_str);
2443+
lcontent_length = std::stoi(content_length_c_str);
24442444
}
24452445
catch (const std::invalid_argument& ia) {
24462446
err = TRITONSERVER_ErrorNew(
@@ -2484,7 +2484,7 @@ HTTPAPIServer::GetInferenceHeaderLength(
24842484
if (header_length_c_str != NULL) {
24852485
int parsed_value;
24862486
try {
2487-
parsed_value = std::atoi(header_length_c_str);
2487+
parsed_value = std::stoi(header_length_c_str);
24882488
}
24892489
catch (const std::invalid_argument& ia) {
24902490
return TRITONSERVER_ErrorNew(

src/sagemaker_server.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ SagemakerAPIServer::GetInferenceHeaderLength(
9898
int32_t parsed_value;
9999
try {
100100
parsed_value =
101-
std::atoi(content_type_c_str + binary_mime_type_.length());
101+
std::stoi(content_type_c_str + binary_mime_type_.length());
102102
}
103103
catch (const std::invalid_argument& ia) {
104104
return TRITONSERVER_ErrorNew(
@@ -508,7 +508,7 @@ SagemakerAPIServer::SageMakerMMEHandleInfer(
508508
evhtp_kv_find(req->headers_in, kContentLengthHeader);
509509
if (content_length_c_str != nullptr) {
510510
try {
511-
content_length = std::atoi(content_length_c_str);
511+
content_length = std::stoi(content_length_c_str);
512512
}
513513
catch (const std::invalid_argument& ia) {
514514
err = TRITONSERVER_ErrorNew(

src/vertex_ai_server.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ VertexAiAPIServer::GetInferenceHeaderLength(
7979
int32_t parsed_value;
8080
try {
8181
parsed_value =
82-
std::atoi(content_type_c_str + binary_mime_type_.length());
82+
std::stoi(content_type_c_str + binary_mime_type_.length());
8383
}
8484
catch (const std::invalid_argument& ia) {
8585
return TRITONSERVER_ErrorNew(

0 commit comments

Comments
 (0)