I found it, after some diligent searching, but now I've run into a new problem. I'm not sure what the failure is, but I'm trying to rewrite my program for VS Express and trying to take advantage of the "safe" versions of string functions:
void disp_error(char *errstr, char *file, int line)
{
char errmsg[128];
_strnset_s( errmsg, 128, 0, 128); <== assertion failure!
sprintf_s( errmsg, 128, "ERROR: %s, file: %s, line: %d\n", errstr, file, line );
puts( errmsg );
}
I don't know why this is failing. I've tried sizeof(errmsg) and as you can see, the last attempt is using a hard coded 128. I'm not even sure what the assertion is testing, because it doesn't mean squat! It says:
Expression: (L"String not null terminated" && 0)
I'm trying to NUL the entire string to prevent problems of non-terminated strings. So, how the f do I do it under VS Express?