_snprintf 会不会有执行失败的时候?
返回值正负都有含义。那么0代表执行失败?
[解决办法]
If len = count, then len characters are stored in buffer, no null-terminator is appended, and len is returned.
msdn的解释
[解决办法]
If buffer is a null pointer and count is nonzero, or format is a null pointer, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, these functions return -1 and set errno to EINVAL.
[解决办法]
if (-1 == _snprintf(...))
{
if (errno != EINVAL)
//返回错误;
}
[解决办法]
有执行失败的时候,GetLastError