summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-01-11 03:23:22 +0200
committerTimo Teräs <timo.teras@iki.fi>2020-01-11 11:20:45 +0200
commit6da3e8eb15c0456b9908bedfdeced2f3a550b58c (patch)
treebd6384ddf991a4ad9b33132691fc11ddb8498edb /src/blob.c
parent7ca0d146ecaf2f99781653d1203bd3db7afc85ba (diff)
downloadapk-tools-6da3e8eb15c0456b9908bedfdeced2f3a550b58c.tar.gz
apk-tools-6da3e8eb15c0456b9908bedfdeced2f3a550b58c.tar.bz2
apk-tools-6da3e8eb15c0456b9908bedfdeced2f3a550b58c.tar.xz
apk-tools-6da3e8eb15c0456b9908bedfdeced2f3a550b58c.zip
istream, archive, db: convert db and tar function to use istream
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/blob.c b/src/blob.c
index c6c5029..68a596e 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -174,13 +174,11 @@ int apk_blob_split(apk_blob_t blob, apk_blob_t split, apk_blob_t *l, apk_blob_t
{
char *pos = blob.ptr, *end = blob.ptr + blob.len - split.len + 1;
- if (end < pos)
- return 0;
+ if (!pos || end < pos) return 0;
while (1) {
pos = memchr(pos, split.ptr[0], end - pos);
- if (pos == NULL)
- return 0;
+ if (!pos) return 0;
if (split.len > 1 && memcmp(pos, split.ptr, split.len) != 0) {
pos++;