Fix MSVC warnings

This commit is contained in:
Victor Zverovich
2016-06-15 06:29:47 -07:00
parent a201c61977
commit e0d6f630f8
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -164,7 +164,8 @@ class WidthHandler : public ArgVisitor<WidthHandler, unsigned> {
spec_.align_ = ALIGN_LEFT;
width = 0 - width;
}
if (width > std::numeric_limits<int>::max())
unsigned int_max = std::numeric_limits<int>::max();
if (width > int_max)
FMT_THROW(FormatError("number is too big"));
return static_cast<unsigned>(width);
}