Skip to content

Commit

Permalink
fix: 🐛 fix overflow for unsigned json deserialization from string
Browse files Browse the repository at this point in the history
  • Loading branch information
Xminent committed Jan 17, 2024
1 parent 21174e3 commit db4eaad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/ekizu/json_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void deserialize_int(const std::string &str, T &value) {
if constexpr (std::is_signed_v<T>) {
value = std::stoi(str);
} else if constexpr (std::is_unsigned_v<T>) {
value = static_cast<T>(std::stoul(str));
value = static_cast<T>(std::stoull(str));
}
} catch (...) {}
}
Expand Down

0 comments on commit db4eaad

Please sign in to comment.