I never return pointers to local variables, what I did is make the caller pass a pointer to it's own local variable which gets the new string copied into it.
And the only time I convert to backslashes is when I use fopen to check if the file exists or not, but I still have no idea why I'm getting this error.
OR, is hl keeping a pointer to szNewpath when I call PRECACHE_SOUND?
That would explain a lot but I'd assume it makes a copy first.
[Added]
Well, it looks like HL needs a copy of the string.
The problem was solved by changing szNewpath to STRING( ALLOC_STRING( szNewpath ) ).
Bah, I would never keep a string pointer like that.
Thanks PMB, now I can get back to finishing this thing
