summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/blob.c b/src/blob.c
index aaaa377..8cf4076 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -44,8 +44,10 @@ int apk_blob_spn(apk_blob_t blob, const char *accept, apk_blob_t *l, apk_blob_t
for (i = 0; i < blob.len; i++) {
if (strchr(accept, blob.ptr[i]) == NULL) {
- *l = APK_BLOB_PTR_LEN(blob.ptr, i);
- *r = APK_BLOB_PTR_LEN(blob.ptr+i, blob.len-i);
+ if (l != NULL)
+ *l = APK_BLOB_PTR_LEN(blob.ptr, i);
+ if (r != NULL)
+ *r = APK_BLOB_PTR_LEN(blob.ptr+i, blob.len-i);
return 1;
}
}
@@ -58,8 +60,10 @@ int apk_blob_cspn(apk_blob_t blob, const char *reject, apk_blob_t *l, apk_blob_t
for (i = 0; i < blob.len; i++) {
if (strchr(reject, blob.ptr[i]) != NULL) {
- *l = APK_BLOB_PTR_LEN(blob.ptr, i);
- *r = APK_BLOB_PTR_LEN(blob.ptr+i, blob.len-i);
+ if (l != NULL)
+ *l = APK_BLOB_PTR_LEN(blob.ptr, i);
+ if (r != NULL)
+ *r = APK_BLOB_PTR_LEN(blob.ptr+i, blob.len-i);
return 1;
}
}