Print this page
locale stuff should use libc safe lmalloc.  Other fixes from tests.

@@ -36,10 +36,11 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdio.h>
 
+#include "libc.h"
 #include "ldpart.h"
 #include "setlocale.h"
 
 static int split_lines(char *, const char *);
 

@@ -73,11 +74,11 @@
         if (st.st_size <= 0) {
                 errno = EINVAL;
                 goto bad_locale;
         }
         bufsize = namesize + st.st_size;
-        if ((lbuf = malloc(bufsize)) == NULL) {
+        if ((lbuf = libc_malloc(bufsize)) == NULL) {
                 errno = ENOMEM;
                 goto bad_locale;
         }
         (void) strcpy(lbuf, name);
         p = lbuf + namesize;