aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@gmail.com>2023-12-01 06:50:24 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2023-12-09 01:06:13 +0000
commit2a163c3649e59dd616e057994ec02092362f0ae7 (patch)
tree14990dc3fae6a983e9218c57f2977a76acb055de
parentfb17dfa0c83cc213400fe7e1ed7a39253a4fcefa (diff)
downloadsrc-2a163c3649e59dd616e057994ec02092362f0ae7.tar.gz
src-2a163c3649e59dd616e057994ec02092362f0ae7.zip
strfmon.3: Cleanup example code
- xlocale.h would have been required if using strfmon_l(). Here, setlocale() just requires locale.h. - ANSIfy function declaration. - Add a final return(). MFC after: 1 week
-rw-r--r--lib/libc/stdlib/strfmon.38
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/stdlib/strfmon.3 b/lib/libc/stdlib/strfmon.3
index 7cd283573239..20cc560d401d 100644
--- a/lib/libc/stdlib/strfmon.3
+++ b/lib/libc/stdlib/strfmon.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd January 25, 2023
+.Dd December 6, 2023
.Dt STRFMON 3
.Os
.Sh NAME
@@ -154,10 +154,10 @@ to the string
.Bd -literal -offset indent
#include <stdio.h>
#include <monetary.h>
-#include <xlocale.h>
+#include <locale.h>
int
-main()
+main(void)
{
char string[100];
double money = 1234567.89;
@@ -169,6 +169,8 @@ main()
strfmon(string, sizeof(string) - 1, "%n", money);
printf("%s\\n", string);
+
+ return (0);
}
.Ed
.Sh ERRORS