snprintf does guarantee NUL-termination,
Oh, does it? That’s very interesting. You are correct - it is strncpy() that does not null-terminate if the source length is greater than N.
I guess I have not tried to memorise the subtle variations of behaviour of all of these functions, and just pessimistically assume the worst….
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: