aboutsummaryrefslogtreecommitdiff
path: root/lib/io/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/io/src')
-rw-r--r--lib/io/src/get_line.c3
-rw-r--r--lib/io/src/istream.c12
-rw-r--r--lib/io/src/xfrm/istream.c7
3 files changed, 6 insertions, 16 deletions
diff --git a/lib/io/src/get_line.c b/lib/io/src/get_line.c
index 94ae9ce..4dc221a 100644
--- a/lib/io/src/get_line.c
+++ b/lib/io/src/get_line.c
@@ -85,8 +85,7 @@ int istream_get_line(istream_t *strm, char **out,
line_len += count;
line[line_len] = '\0';
- if (istream_advance_buffer(strm, i))
- goto fail_free;
+ istream_advance_buffer(strm, i);
if (have_line) {
if (line_len > 0 && line[line_len - 1] == '\r')
diff --git a/lib/io/src/istream.c b/lib/io/src/istream.c
index b4c709c..9340dd6 100644
--- a/lib/io/src/istream.c
+++ b/lib/io/src/istream.c
@@ -29,13 +29,10 @@ sqfs_s32 istream_read(istream_t *strm, void *data, size_t size)
diff = size;
memcpy(data, ptr, diff);
+ istream_advance_buffer(strm, diff);
data = (char *)data + diff;
size -= diff;
total += diff;
-
- ret = istream_advance_buffer(strm, diff);
- if (ret)
- return -1;
}
return total;
@@ -61,9 +58,7 @@ int istream_skip(istream_t *strm, sqfs_u64 size)
diff = size;
size -= diff;
-
- if (istream_advance_buffer(strm, diff))
- return -1;
+ istream_advance_buffer(strm, diff);
}
return 0;
@@ -92,11 +87,10 @@ sqfs_s32 istream_splice(istream_t *in, ostream_t *out, sqfs_u32 size)
if (ostream_append(out, ptr, diff))
return -1;
- if (istream_advance_buffer(in, diff))
- return -1;
total += diff;
size -= diff;
+ istream_advance_buffer(in, diff);
}
return total;
diff --git a/lib/io/src/xfrm/istream.c b/lib/io/src/xfrm/istream.c
index 8755cb6..bad3e22 100644
--- a/lib/io/src/xfrm/istream.c
+++ b/lib/io/src/xfrm/istream.c
@@ -18,7 +18,7 @@ typedef struct istream_xfrm_t {
static int xfrm_precache(istream_t *base)
{
istream_xfrm_t *xfrm = (istream_xfrm_t *)base;
- int ret, sret;
+ int ret;
assert(base->buffer >= xfrm->uncompressed);
assert(base->buffer <= (xfrm->uncompressed + BUFSZ));
@@ -59,10 +59,7 @@ static int xfrm_precache(istream_t *base)
}
base->buffer_used = out_off;
-
- sret = istream_advance_buffer(xfrm->wrapped, in_off);
- if (sret != 0)
- return sret;
+ istream_advance_buffer(xfrm->wrapped, in_off);
if (ret == XFRM_STREAM_BUFFER_FULL || out_off >= BUFSZ)
break;