From: Kevin Day Date: Thu, 29 Aug 2019 00:53:24 +0000 (-0500) Subject: Cleanup: define fl_directory_name_max as 255 to match PATH_NAME X-Git-Tag: 0.5.0~475 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=afd07e644c8d939686875dfffd964447615cb7c7;p=fll Cleanup: define fl_directory_name_max as 255 to match PATH_NAME --- diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index 06956d7..7ee05d3 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -20,7 +20,7 @@ extern "C" { length = scandir(directory_path, &listing, 0, alphasort); for (; counter < length; counter++) { - size = strnlen(listing[counter]->d_name, 256); // as far as I can tell 256 is the max directory name length + size = strnlen(listing[counter]->d_name, fl_directory_name_max); // there is no reason to include "." and ".." in the directory listing if (strncmp(listing[counter]->d_name, "..", 3) != 0 && strncmp(listing[counter]->d_name, ".", 2) != 0) { diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index ba275cb..b002497 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -30,6 +30,8 @@ extern "C" { #ifndef _di_fl_directory_limitations_ #define fl_directory_default_allocation_step f_memory_default_allocation_step + + #define fl_directory_name_max 255 #endif // _di_fl_directory_limitations_ #ifndef _di_fl_directory_list_