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) {
#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_