mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 06:21:00 +00:00
Take integer promotion into account.
This commit is contained in:
parent
910dec5ed3
commit
137153b9f0
@ -300,7 +300,7 @@ template <typename T, typename U>
|
||||
std::string sprintf_int(std::string format, U value) {
|
||||
char buffer[BUFFER_SIZE];
|
||||
char type = format[format.size() - 1];
|
||||
if (sizeof(T) < sizeof(U)) {
|
||||
if (sizeof(T) < sizeof(int)) {
|
||||
if (type == 'd' || type == 'i') {
|
||||
typedef typename MakeSigned<T>::Type Signed;
|
||||
safe_sprintf(buffer, format.c_str(), static_cast<Signed>(value));
|
||||
|
Loading…
Reference in New Issue
Block a user