]> Kevux Git Server - fll/commitdiff
Cleanup: define fl_directory_name_max as 255 to match PATH_NAME
authorKevin Day <thekevinday@gmail.com>
Thu, 29 Aug 2019 00:53:24 +0000 (19:53 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 29 Aug 2019 00:53:24 +0000 (19:53 -0500)
level_1/fl_directory/c/directory.c
level_1/fl_directory/c/directory.h

index 06956d76f5af47bd505cd2d3f3af0a93bdf36d87..7ee05d3161dd9922be3a9d6afe63a933bbefcfae 100644 (file)
@@ -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) {
index ba275cb967769f3700b33f3e5ac8f5c97eba2919..b00249718fcc40d83126e33caa98563a83d15a86 100644 (file)
@@ -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_