change sprintf_s retval to -1 on errors
See GH #45. In this case I (and all others) think the standard made an error. All existing implementations do return -1 on errors, all similar functions do return -1. The revision and rationale for this change is: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1141.pdf keeping count += sprintf(buf + count, format_string, args); valid, when no encoding errors can occur. google site:www.open-std.org vsprintf_s. Even Microsoft itself, who changed this behaviour in the standard with n1141, changed it later back to return -1 consistently. Document the deviation, and test it against msvcrt.
parent
90e9db1e
Please register or sign in to comment