mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-19 09:35:15 -04:00
Fix printing of negative values
This commit is contained in:
parent
ed019e99e6
commit
c7cf87569e
@ -590,7 +590,7 @@ template<>
|
||||
inline std::string to_string<int64_t>(const int64_t& value){
|
||||
if(value < 0){
|
||||
std::string s("-");
|
||||
s += to_string(static_cast<uint64_t>(value));
|
||||
s += to_string(static_cast<uint64_t>(-value));
|
||||
return std::move(s);
|
||||
} else {
|
||||
return to_string(static_cast<uint64_t>(value));
|
||||
@ -666,7 +666,7 @@ template<>
|
||||
inline void to_raw_string<int64_t>(const int64_t& value, char* buffer, size_t n){
|
||||
if(value < 0){
|
||||
*buffer = '-';
|
||||
to_raw_string(static_cast<uint64_t>(value), buffer + 1, n - 1);
|
||||
to_raw_string(static_cast<uint64_t>(-value), buffer + 1, n - 1);
|
||||
} else {
|
||||
to_raw_string(static_cast<uint64_t>(value), buffer, n);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user