summaryrefslogtreecommitdiffstats
path: root/lib/dpkg/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dpkg/buffer.c')
-rw-r--r--lib/dpkg/buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/dpkg/buffer.c b/lib/dpkg/buffer.c
index ed05f4b..3d4ed9e 100644
--- a/lib/dpkg/buffer.c
+++ b/lib/dpkg/buffer.c
@@ -184,7 +184,7 @@ buffer_copy(struct buffer_data *read_data,
off_t bytesread = 0, byteswritten = 0;
off_t totalread = 0, totalwritten = 0;
- if ((limit != -1) && (limit < bufsize))
+ if ((limit >= 0) && (limit < bufsize))
bufsize = limit;
if (bufsize == 0)
buf = NULL;
@@ -202,7 +202,7 @@ buffer_copy(struct buffer_data *read_data,
totalread += bytesread;
- if (limit != -1) {
+ if (limit >= 0) {
limit -= bytesread;
if (limit < bufsize)
bufsize = limit;
@@ -267,7 +267,7 @@ buffer_skip(struct buffer_data *input, off_t limit, struct dpkg_error *err)
switch (input->type) {
case BUFFER_READ_FD:
- if (lseek(input->arg.i, limit, SEEK_CUR) != -1)
+ if (lseek(input->arg.i, limit, SEEK_CUR) >= 0)
return limit;
if (errno != ESPIPE)
return dpkg_put_errno(err, _("failed to seek"));