Skip to content

Commit

Permalink
Fix int64_t -> unsigned conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
foonathan committed Mar 13, 2018
1 parent 6cefc52 commit b4a17fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,9 @@ class basic_format_args {

unsigned max_size() const {
int64_t signed_types = static_cast<int64_t>(types_);
return signed_types < 0 ?
-signed_types : static_cast<int64_t>(internal::max_packed_args);
return static_cast<unsigned>(signed_types < 0
? -signed_types
: static_cast<int64_t>(internal::max_packed_args));
}
};

Expand Down

0 comments on commit b4a17fe

Please sign in to comment.