From a2a24daa63f933247564ac5ff19e2f7e1fd24e81 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 11 Oct 2019 12:56:49 +0200 Subject: Remove usage of strchrnul from libsquashfs Signed-off-by: David Oberhollenzer --- lib/sqfs/dir_reader.c | 10 ++++++++-- lib/sqfs/read_tree.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'lib/sqfs') 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); diff --git a/lib/sqfs/read_tree.c b/lib/sqfs/read_tree.c index f9c2a4e..eaf7c16 100644 --- a/lib/sqfs/read_tree.c +++ b/lib/sqfs/read_tree.c @@ -225,8 +225,14 @@ int sqfs_dir_reader_get_full_hierarchy(sqfs_dir_reader_t *rd, goto fail; ptr = strchr(path, '/'); - if (ptr == NULL) - ptr = strchrnul(path, '\\'); + if (ptr == NULL) { + ptr = strchr(path, '\\'); + + if (ptr == NULL) { + for (ptr = path; *ptr != '\0'; ++ptr) + ; + } + } for (;;) { ret = sqfs_dir_reader_read(rd, &ent); -- cgit v1.2.3