A friendly reminder for everyone:
C strings are NOT the same as QB64 strings.
It seems that everyone -- and, by everyone, I include myself in that count -- has been overlooking that glaringly obvious fact with the direntry.h functions.
Blame me. I didn't catch the glitch when I first released and demoed the routines, and the problem has perpetrated into tons of folks codes and routines.
load_dir _CWD$ may not work as you'd expect with direntry.h. _CWD$ is a QB64 string -- not a C string -- and it's missing one very important thing: the null, end-of-string, terminator!
If you're using the direntry.h routines, go back and double check your programs to make certain that you null terminate them.
If you're using the demos I provided as a template for your own work, you should see something like the following in your code:
CONST IS_DIR = 1
DIM flags AS LONG, file_size AS LONG, length, nam$
IF load_dir(SearchDirectory) THEN
You will probably want to null terminate that search string with something like the following:
CONST IS_DIR = 1
DIM flags AS LONG, file_size AS LONG, length, nam$
IF load_dir(SearchDirectory + CHR$(0)) THEN
You've been warned here first. :)