Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

yes - snprintf() returns the length of the string that would be written even if it wasn't clipped to the length of the output buffer - if you want to accumulate strings into a buffer using the output length to update the offset/size bad things will happen.

scnprintf() returns the actual number of bytes written (less the null)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: