mirror of https://github.com/mkerrisk/man-pages
readlink.2: Emphasize that the returned buffer is not null-terminated
Reported-by: Jonny Grant <jg@jguk.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
5bd94cbd31
commit
ab4001e286
|
@ -93,7 +93,7 @@ in the buffer
|
|||
which has size
|
||||
.IR bufsiz .
|
||||
.BR readlink ()
|
||||
does not append a null byte to
|
||||
does not append a terminating null byte to
|
||||
.IR buf .
|
||||
It will (silently) truncate the contents (to a length of
|
||||
.I bufsiz
|
||||
|
@ -332,6 +332,8 @@ main(int argc, char *argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Print only \(aqnbytes\(aq of \(aqbuf\(aq, as it doesn't contain a terminating
|
||||
null byte (\(aq\e0\(aq). */
|
||||
printf("\(aq%s\(aq points to \(aq%.*s\(aq\en", argv[1], (int) nbytes, buf);
|
||||
|
||||
/* If the return value was equal to the buffer size, then the
|
||||
|
|
Loading…
Reference in New Issue