Skip to content

Commit

Permalink
Merge pull request #1269 from Nivaturimika/patch-34
Browse files Browse the repository at this point in the history
replace strlen with something more sensible simple_fs_nix.cpp
  • Loading branch information
schombert authored Apr 13, 2024
2 parents 3dad881 + f2561bb commit 0b135f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/filesystem/simple_fs_nix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ std::vector<unopened_file> list_files(directory const& dir, native_char const* e
continue;

// Check if the file is of the right extension
if(strlen(extension)) {
if(extension && extension[0] != 0) {
char* dot = strrchr(dir_ent->d_name, '.');
if(!dot || dot == dir_ent->d_name)
continue;
Expand Down Expand Up @@ -249,7 +249,7 @@ std::vector<unopened_file> list_files(directory const& dir, native_char const* e
continue;

// Check if the file is of the right extension
if(strlen(extension)) {
if(extension && extension[0] != 0) {
char* dot = strrchr(dir_ent->d_name, '.');
if(!dot || dot == dir_ent->d_name)
continue;
Expand Down

0 comments on commit 0b135f2

Please sign in to comment.