]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - localedata/tst-fmon.c
Fix nscd/cachedumper.c compile errors
[thirdparty/glibc.git] / localedata / tst-fmon.c
index d662539045269a6cc9a0082e6dc1af7df141db9d..402421587fa1cc184000b9dd50ef91e5791204b0 100644 (file)
@@ -1,5 +1,5 @@
 /* Testing the implementation of strfmon(3).
-   Copyright (C) 1996-2014 Free Software Foundation, Inc.
+   Copyright (C) 1996-2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jochen Hein <jochen.hein@delphi.central.de>, 1997.
 
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
 #include <locale.h>
@@ -40,7 +40,7 @@
 int
 main (int argc, char *argv[])
 {
-  char *s = malloc (201);
+  char s[200];
 
   if (setlocale (LC_MONETARY, argv[1]) == NULL)
     {
@@ -48,7 +48,7 @@ main (int argc, char *argv[])
       exit (EXIT_SETLOCALE);
     }
 
-  if (strfmon (s, 200, argv[2], (double) atof (argv[3])) == -1)
+  if (strfmon (s, sizeof (s), argv[2], (double) atof (argv[3])) == -1)
     {
       perror ("strfmon");
       exit (EXIT_STRFMON);