Commit 137153b9 authored by Victor Zverovich's avatar Victor Zverovich

Take integer promotion into account.

parent 910dec5e
......@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment