mirror of
https://github.com/torarnv/sparsebundlefs.git
synced 2026-03-03 18:28:07 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user