replace ULONG_MAX with c++ style std::numeric_limits
[apt.git] / methods / rred.cc
index 12cf2b4a5dc4a0d9b3f3d0e83e473581f1d5551b..54123ab9c5ecc3c720f5016fa06af863106d9998 100644 (file)
@@ -405,12 +405,12 @@ class Patch {
            size_t s, e;
            errno = 0;
            s = strtoul(buffer, &m, 10);
-           if (unlikely(m == buffer || s == ULONG_MAX || errno != 0))
+           if (unlikely(m == buffer || s == std::numeric_limits<unsigned long>::max() || errno != 0))
               return _error->Error("Parsing patchfile %s failed: Expected an effected line start", f.Name().c_str());
            else if (*m == ',') {
               ++m;
               e = strtol(m, &c, 10);
-              if (unlikely(m == c || e == ULONG_MAX || errno != 0))
+              if (unlikely(m == c || e == std::numeric_limits<unsigned long>::max() || errno != 0))
                  return _error->Error("Parsing patchfile %s failed: Expected an effected line end", f.Name().c_str());
               if (unlikely(e < s))
                  return _error->Error("Parsing patchfile %s failed: Effected lines end %lu is before start %lu", f.Name().c_str(), e, s);