B
Bruno van Dooren
Hi,
this might be a strange question, but why is snprintf not guaranteed to nul
terminate a string?
i thought the whole point of those sn functions was to prevent these errors.
sure, they prevent buffer overwrites, but callers can still screw up bad if
they don't always make sure for themselves that the 0 is there before they
let someone else read the contents.
now you still have the problem that you have to make that check everywhere,
instead of not having to bother.
kind regards,
Bruno.
this might be a strange question, but why is snprintf not guaranteed to nul
terminate a string?
i thought the whole point of those sn functions was to prevent these errors.
sure, they prevent buffer overwrites, but callers can still screw up bad if
they don't always make sure for themselves that the 0 is there before they
let someone else read the contents.
now you still have the problem that you have to make that check everywhere,
instead of not having to bother.
kind regards,
Bruno.