diff --git a/format.h b/format.h index d3d00bcc..e75bced1 100644 --- a/format.h +++ b/format.h @@ -1140,7 +1140,7 @@ class FormatInt { public: explicit FormatInt(int value) { - uint64_t abs_value = value; + unsigned abs_value = value; bool negative = value < 0; if (negative) abs_value = 0 - value; diff --git a/format_test.cc b/format_test.cc index c9e8357c..b57390f3 100644 --- a/format_test.cc +++ b/format_test.cc @@ -1287,6 +1287,7 @@ TEST(FormatterTest, Examples) { TEST(FormatIntTest, FormatInt) { EXPECT_EQ("42", fmt::FormatInt(42).str()); + EXPECT_EQ("-42", fmt::FormatInt(-42).str()); } template