[devel] [PATCH for apt 07/38] Use signed types to detect IO errors
Aleksei Nikiforov
darktemplar на altlinux.org
Вт Дек 10 18:23:12 MSK 2019
Found via cppcheck
---
apt/apt-pkg/contrib/strutl.cc | 2 +-
apt/methods/gzip.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/apt/apt-pkg/contrib/strutl.cc b/apt/apt-pkg/contrib/strutl.cc
index bde4ef5..c07e65c 100644
--- a/apt/apt-pkg/contrib/strutl.cc
+++ b/apt/apt-pkg/contrib/strutl.cc
@@ -1017,7 +1017,7 @@ void ioprintf(ostream &out,const char *format,...)
consecutive snprintfs. */
char *safe_snprintf(char *Buffer,char *End,const char *Format,...)
{
- unsigned long Did;
+ int Did;
if (End <= Buffer)
return End;
diff --git a/apt/methods/gzip.cc b/apt/methods/gzip.cc
index 0f39210..db61e69 100644
--- a/apt/methods/gzip.cc
+++ b/apt/methods/gzip.cc
@@ -95,7 +95,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
while (1)
{
unsigned char Buffer[4*1024];
- unsigned long long Count;
+ ssize_t Count;
Count = read(GzOut[0],Buffer,sizeof(Buffer));
if (Count < 0 && errno == EINTR)
--
2.24.0
Подробная информация о списке рассылки Devel