Closed apsun closed 7 years ago
If the length of the input buffer is too small, we should either return -1 or at least make sure the string is NUL-terminated, since the test programs assume that if the call succeeded, the buffer is valid.
if (nbytes > 0) { buf[nbytes - 1] = '\0'; }
Fixed in r12578
If the length of the input buffer is too small, we should either return -1 or at least make sure the string is NUL-terminated, since the test programs assume that if the call succeeded, the buffer is valid.