Skip to content

Commit 4700388

Browse files
committed
test
1 parent c5b88cc commit 4700388

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

extension/data_loader/file_data_loader.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <executorch/runtime/core/error.h>
2323
#include <executorch/runtime/core/result.h>
2424
#include <executorch/runtime/platform/log.h>
25+
#include <charconv>
2526

2627
// Some platforms (e.g. Xtensa) do not support pread() that we use to read the
2728
// file at different offsets simultaneously from multiple threads not affecting
@@ -98,7 +99,11 @@ Result<int> getFDFromUri(const char* file_descriptor_uri) {
9899
fd_without_prefix[fd_len] = '\0';
99100

100101
// check if remaining fd string is a valid integer
101-
int fd = ::atoi(fd_without_prefix);
102+
// int fd = strtol(fd_without_prefix, NULL, 10);
103+
// int fd = ::atoi(fd_without_prefix);
104+
// int fd = parse_int(fd_without_prefix);
105+
int fd;
106+
std::from_chars(fd_without_prefix, fd_without_prefix + fd_len, fd);
102107
return fd;
103108
}
104109

0 commit comments

Comments
 (0)