Sort a list of file names from SD card

System Volume Information
MusicBee
datalog.bin
Ftest1
SDTEST1.wav
SDTEST with super long file name.wav
New Folder Test
Sorting....

...and then it hangs and restarts.

So we get the unsorted list of files/directories as they are read from the SD card's root folder, but as soon as we get to the Qsort section it all falls over.

I suspect the comparison function may be to blame. However, my knowledge of casting types and referencing/deferencing pointers is patchier than the wifi coverage in my house, so it could be something completely different.