high!
i was trying to create dynamic filenames using it - almost the same thing that you trying to do. here Gordon's comments about strcpy() and strcat(): maybe it can helps.
it looks like strcat() broken. maybe Gordon allready fixed it - i found alternative and forget to check it back...