diff options
author | Julian Andres Klode <jak@debian.org> | 2015-12-14 13:58:46 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2015-12-14 13:58:46 +0100 |
commit | 137e8ad4b6ce28b1a1355d5a125d09670388c2b7 (patch) | |
tree | f90df18be1ccfe83fc624ae87182254a02adc323 /apt-pkg/tagfile.cc | |
parent | 950733c947acd50afe498e900954d911454c57e7 (diff) |
tagfile: Hardcode error message for out of range integer values
This makes the test suite work on 32 bit-long platforms.
Gbp-Dch: ignore
Diffstat (limited to 'apt-pkg/tagfile.cc')
-rw-r--r-- | apt-pkg/tagfile.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 8acecd735..2bef9b48b 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -537,11 +537,10 @@ signed int pkgTagSection::FindI(const char *Tag,signed long Default) const errno = 0; char *End; signed long Result = strtol(S,&End,10); - if (errno == ERANGE) - _error->Errno("strtol", _("Cannot convert %s to integer"), S); - if (Result < std::numeric_limits<int>::min() || Result > std::numeric_limits<int>::max()) { + if (errno == ERANGE || + Result < std::numeric_limits<int>::min() || Result > std::numeric_limits<int>::max()) { errno = ERANGE; - _error->Errno("", _("Cannot convert %s to integer"), S); + _error->Error(_("Cannot convert %s to integer: out of range"), S); } if (S == End) return Default; |