This statement could go past the end of array:
> strncat(Buffer, FileNameBuffer[nCount], 10);

You are telling it to concatenate 10 characters, but you buffer only holds 9 characters.

Also you might try declaring this array above main(), due to its size:
>char FileNameBuffer[100] [100] = {0}; // this holds files containing *.idx