J
jacob navia
snprintf accepts a buffersize of zero and a null buffer pointer. That
means that snprintf is used to just calculate the number of characters
that would be required by the given format string and arguments.
Now snprintf_s however REQUIRES that the buffer is never NULL and that n
is always bigger than zero.
Why this discrepancy?
In general the _s functions are just the same functions as their
"normal" counterparts with extra checks. Why this difference here?
Or is it just a bug?
means that snprintf is used to just calculate the number of characters
that would be required by the given format string and arguments.
Now snprintf_s however REQUIRES that the buffer is never NULL and that n
is always bigger than zero.
Why this discrepancy?
In general the _s functions are just the same functions as their
"normal" counterparts with extra checks. Why this difference here?
Or is it just a bug?