From 59cc636d94a6c9b28147304fa59351224f801e92 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Tue, 8 Nov 2022 17:53:17 -0300 Subject: [PATCH] strfmon(3): Wording improvements Use the same terminology as the other `_l` xlocale(3) functions. Reviewed by: kib MFC after: 1 week --- lib/libc/stdlib/strfmon.3 | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/libc/stdlib/strfmon.3 b/lib/libc/stdlib/strfmon.3 index 1ddfb77cb0a..5c110a8987d 100644 --- a/lib/libc/stdlib/strfmon.3 +++ b/lib/libc/stdlib/strfmon.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2022 +.Dd January 25, 2023 .Dt STRFMON 3 .Os .Sh NAME @@ -37,13 +37,15 @@ .In monetary.h .Ft ssize_t .Fn strfmon "char * restrict s" "size_t maxsize" "const char * restrict format" "..." +.In monetary.h +.In xlocale.h .Ft ssize_t .Fn strfmon_l "char * restrict s" "size_t maxsize" "locale_t loc" "const char * restrict format" "..." .Sh DESCRIPTION The .Fn strfmon function places characters into the array pointed to by -.Fa s +.Fa s , as controlled by the string pointed to by .Fa format . No more than @@ -52,9 +54,9 @@ bytes are placed into the array. .Pp The .Fn strfmon_l -function does the same as +function takes an explicit locale argument, whereas the .Fn strfmon -but takes an explicit locale rather than using the current locale. +function uses the current global or per-thread locale. .Pp The format string is composed of zero or more directives: ordinary characters (not @@ -129,12 +131,14 @@ character is written. .El .El .Sh RETURN VALUES -If the total number of resulting bytes including the terminating +If the total number of resulting bytes, including the terminating .Dv NUL -byte is not more than +byte, is not more than .Fa maxsize , .Fn strfmon -returns the number of bytes placed into the array pointed to by +and +.Fn strfmon_l +return the number of bytes placed into the array pointed to by .Fa s , not including the terminating .Dv NUL @@ -144,11 +148,6 @@ the contents of the array are indeterminate, and .Va errno is set to indicate the error. -.Pp -The -.Fn strfmon_l -function returns the same values as -.Fn strfmon . .Sh EXAMPLES The following example will format the value .Dq Li 1234567.89 -- 2.45.0