Fix warning about comparison between signed and unsigned ints

We assume numeric_limits<off_t>::max() will not return a negative
number, so casting should be safe.
This commit is contained in:
Tor Arne Vestbø
2012-10-01 20:34:49 +02:00
parent 357e446d94
commit f9c2e41d6e

View File

@@ -155,7 +155,7 @@ using namespace std;
static off_t read_size(const string &str)
{
uintmax_t value = strtoumax(str.c_str(), 0, 10);
if (errno == ERANGE || value > numeric_limits<off_t>::max()) {
if (errno == ERANGE || value > static_cast<uintmax_t>(numeric_limits<off_t>::max())) {
fprintf(stderr, "Disk image too large to be mounted (%s bytes)\n", str.c_str());
exit(-1);
}