nl_langinfo.3: Enhance RETURN VALUE description

Note some further cases where returned string may be
invalidated or overwritten.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-08-07 13:39:30 +02:00
parent 7003ff6ad0
commit cc331dfc6c
1 changed files with 13 additions and 3 deletions

View File

@ -131,11 +131,21 @@ data is not defined.
.PP
If \fIitem\fP is not valid, a pointer to an empty string is returned.
.PP
This pointer may point to static data that may be overwritten on the
next call to
.BR nl_langinfo ()
The pointer returned by these functions may point to static data that
may be overwritten, or the pointer itself may be invalidated,
by a subsequent call to
.BR nl_langinfo (),
.BR nl_langinfo_l (),
or
.BR setlocale (3).
The same statements apply to
.BR nl_langinfo_l ()
if the locale object referred to by
.I locale
is freed or modified by
.BR freelocale (3)
or
.BR newlocale (3).
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).