From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 From: Aleksei Nikiforov To: devel@lists.altlinux.org Date: Thu, 12 Dec 2019 12:57:16 +0300 Message-Id: <20191212095730.83787-8-darktemplar@altlinux.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191212095730.83787-1-darktemplar@altlinux.org> References: <20191211234857.GB17949@altlinux.org> <20191212095730.83787-1-darktemplar@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Aleksei Nikiforov Subject: [devel] [PATCH for apt v2 07/21] Use signed types to detect IO errors X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 09:58:33 -0000 Archived-At: List-Archive: List-Post: Found via cppcheck: (style) Checking if unsigned expression 'Did' is less than zero. (style) Checking if unsigned expression 'Count' is less than zero. --- 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.1