
If the buffer is too small, there's no guarantee that it is null terminated. The docs (on both unix and MSVC) say explicitly that the function returns 0 and the buffer contents are indeterminate in this case.
If the buffer is too small, there's no guarantee that it is null terminated. The docs (on both unix and MSVC) say explicitly that the function returns 0 and the buffer contents are indeterminate in this case.