summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorDmitry Golovin <dima@golovin.in>2017-08-22 17:28:21 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-08-23 08:56:44 +0300
commit16336ba2655db7f1df78437deb6de84d16c7c3c1 (patch)
tree557d7aaf407953b431f0d4cc4146afff6ffd336f /src/io.c
parent04003569c54d3cfce7ae7d06199c2ca1e510f38a (diff)
downloadapk-tools-16336ba2655db7f1df78437deb6de84d16c7c3c1.tar.gz
apk-tools-16336ba2655db7f1df78437deb6de84d16c7c3c1.tar.bz2
apk-tools-16336ba2655db7f1df78437deb6de84d16c7c3c1.tar.xz
apk-tools-16336ba2655db7f1df78437deb6de84d16c7c3c1.zip
fix comparison of unsigned expression < 0 is always false
found by clang
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/io.c b/src/io.c
index bfc9c1c..832e06c 100644
--- a/src/io.c
+++ b/src/io.c
@@ -151,7 +151,8 @@ struct apk_istream *apk_istream_from_file(int atfd, const char *file)
size_t apk_istream_skip(struct apk_istream *is, size_t size)
{
unsigned char buf[2048];
- size_t done = 0, r, togo;
+ size_t done = 0, togo;
+ ssize_t r;
while (done < size) {
togo = size - done;
@@ -173,7 +174,8 @@ size_t apk_istream_splice(void *stream, int fd, size_t size,
static void *splice_buffer = NULL;
struct apk_istream *is = (struct apk_istream *) stream;
unsigned char *buf, *mmapbase = MAP_FAILED;
- size_t bufsz, done = 0, r, togo;
+ size_t bufsz, done = 0, togo;
+ ssize_t r;
bufsz = size;
if (size > 128 * 1024) {
@@ -536,7 +538,7 @@ struct apk_bstream *apk_bstream_tee(struct apk_bstream *from, int atfd, const ch
apk_blob_t apk_blob_from_istream(struct apk_istream *is, size_t size)
{
void *ptr;
- size_t rsize;
+ ssize_t rsize;
ptr = malloc(size);
if (ptr == NULL)