mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 00:50:50 +00:00
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
This commit is contained in:
parent
fb17dfa0c8
commit
2a163c3649
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue