diff options
author | Timo Teräs <timo.teras@iki.fi> | 2020-01-11 03:23:22 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-01-11 11:20:45 +0200 |
commit | 6da3e8eb15c0456b9908bedfdeced2f3a550b58c (patch) | |
tree | bd6384ddf991a4ad9b33132691fc11ddb8498edb /src/blob.c | |
parent | 7ca0d146ecaf2f99781653d1203bd3db7afc85ba (diff) | |
download | apk-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.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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++; |