Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.5.3
-
None
-
None
-
At least on windows platforms
-
298aee0577a45dadf8e30b5bea05224f9e3aa52d
Description
qstrncpy() is documented as "[a] safe strncpy() function"
As such, one would expect it to be an exact work-alike of strncpy(). However, strncpy() infills all unused space in the destination buffer with '\0' from the byte just past the last non-'\0' character of the source string up to the last byte of the destination buffer. qstrncpy() places a '\0' at the end of the string, and at the last byte of the buffer, but leaves all intervening bytes (if any) as they were. This behavior makes qstrncpy() unsuitable for some applications where the defautl strncpy() functionality is expected.