summaryrefslogtreecommitdiff
path: root/lib/sqfs/dir_reader.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-11 12:56:49 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-11 13:03:18 +0200
commita2a24daa63f933247564ac5ff19e2f7e1fd24e81 (patch)
tree38649f59f01364822e07010b106b4dde6a227ac9 /lib/sqfs/dir_reader.c
parentacb4156bd5c730d0c62585eb78b2b6ff21a12fe4 (diff)
Remove usage of strchrnul from libsquashfs
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/dir_reader.c')
-rw-r--r--lib/sqfs/dir_reader.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqfs/dir_reader.c b/lib/sqfs/dir_reader.c
index e1ff9bc..bae24d5 100644
--- a/lib/sqfs/dir_reader.c
+++ b/lib/sqfs/dir_reader.c
@@ -235,8 +235,14 @@ int sqfs_dir_reader_find_by_path(sqfs_dir_reader_t *rd, const char *path,
return ret;
ptr = strchr(path, '/');
- if (ptr == NULL)
- ptr = strchrnul(path, '\\');
+ if (ptr == NULL) {
+ ptr = strchr(path, '\\');
+
+ if (ptr == NULL) {
+ for (ptr = path; *ptr != '\0'; ++ptr)
+ ;
+ }
+ }
do {
ret = sqfs_dir_reader_read(rd, &ent);