Skip to content

Commit

Permalink
fix String2int error
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahashen committed Oct 16, 2024
1 parent d65be5c commit 26a9280
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pstd/pstd_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ inline std::string Int2string(T val) {
template <std::integral T>
int String2int(const char* s, size_t slen, T* val) {
auto [ptr, ec] = std::from_chars(s, s + slen, *val);
if (ec != std::errc()) {
return 0;
} else {
if (ptr==s+slen) {
return 1;
} else {
return 0;
}
}

Expand Down

0 comments on commit 26a9280

Please sign in to comment.