diff options
| author | Herman Semenov <GermanAizek@yandex.ru> | 2025-05-11 15:59:02 +0300 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-05-19 15:19:49 +0000 |
| commit | ed78f77ec9b3bb98f05aa43d16545846850774e2 (patch) | |
| tree | eaa14b7fc669200b325255b8d855eed8c84969ae | |
| parent | b4e745bfed0c06b1b7faeceeab32a02a76fb8a54 (diff) | |
apt-pkg: fixed type comparison in 64bit systems using memsize cast
| -rw-r--r-- | apt-pkg/tagfile.cc | 4 | ||||
| -rw-r--r-- | apt-pkg/versionmatch.cc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 26bf70804..fbc9cfb83 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -767,7 +767,7 @@ signed int pkgTagSection::FindIInternal(unsigned int Pos,signed long Default) co // Copy it into a temp buffer so we can use strtol char S[300]; - if ((unsigned)(Stop - Start) >= sizeof(S)) + if ((size_t)(Stop - Start) >= sizeof(S)) return Default; strncpy(S,Start,Stop-Start); S[Stop - Start] = 0; @@ -809,7 +809,7 @@ unsigned long long pkgTagSection::FindULLInternal(unsigned int Pos, unsigned lon // Copy it into a temp buffer so we can use strtoull char S[100]; - if ((unsigned)(Stop - Start) >= sizeof(S)) + if ((size_t)(Stop - Start) >= sizeof(S)) return Default; strncpy(S,Start,Stop-Start); S[Stop - Start] = 0; diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index 3af51e40c..4a8aafd7d 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -143,8 +143,8 @@ bool pkgVersionMatch::MatchVer(const char *A,string B,bool Prefix) const char *Ae = Ab + strlen(A); // Strings are not a compatible size. - if (((unsigned)(Ae - Ab) != B.length() && Prefix == false) || - (unsigned)(Ae - Ab) < B.length()) + if (((size_t)(Ae - Ab) != B.length() && Prefix == false) || + (size_t)(Ae - Ab) < B.length()) return false; // Match (leading?) |
