char strValue[1024] = { 1023 * '=', '\0' }; // 1023 equal signs then NULL (not necessary valid C syntax ...)
char buffer[100];
// make sure final string will be null terminated
buffer[sizeof(buffer)-1] = '\0';
// call _snprintf, but give it one less char than it is available in the buffer (we want to conserve our null-termination)
// for the case when _snprintf will not null-terminate the string (if len >= count)
_snprintf( buffer, sizeof(buffer)-1, "This is my format string '%s'\n", strFormatString);
// at this point buffer is null terminated and valid; look Mom, no IFs! :-)
assert(strlen(buffer) <= sizeof(buffer));