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

*** 36,45 **** --- 36,46 ---- #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,83 **** if (st.st_size <= 0) { errno = EINVAL; goto bad_locale; } bufsize = namesize + st.st_size; ! if ((lbuf = malloc(bufsize)) == NULL) { errno = ENOMEM; goto bad_locale; } (void) strcpy(lbuf, name); p = lbuf + namesize; --- 74,84 ---- if (st.st_size <= 0) { errno = EINVAL; goto bad_locale; } bufsize = namesize + st.st_size; ! if ((lbuf = libc_malloc(bufsize)) == NULL) { errno = ENOMEM; goto bad_locale; } (void) strcpy(lbuf, name); p = lbuf + namesize;