summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/mntent/mntent.c5
-rw-r--r--libc/misc/regex/regex_old.c9
-rw-r--r--libc/misc/ttyent/getttyent.c5
3 files changed, 10 insertions, 9 deletions
diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c
index a5db799dc..a9024be88 100644
--- a/libc/misc/mntent/mntent.c
+++ b/libc/misc/mntent/mntent.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <malloc.h>
#include <mntent.h>
#include <bits/uClibc_mutex.h>
@@ -84,9 +85,7 @@ struct mntent *getmntent(FILE * filep)
__UCLIBC_MUTEX_LOCK(mylock);
if (!buff) {
- buff = malloc(BUFSIZ);
- if (!buff)
- abort();
+ buff = __uc_malloc(BUFSIZ);
}
tmp = getmntent_r(filep, &mnt, buff, BUFSIZ);
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index cf5843ec5..997ee6f8b 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
+#include <malloc.h>
#include <stdio.h>
libc_hidden_proto(memset)
@@ -306,7 +307,7 @@ extern char *re_syntax_table;
# else /* not SYNTAX_TABLE */
-static char re_syntax_table[CHAR_SET_SIZE];
+static char *re_syntax_table; /* [CHAR_SET_SIZE] */
static void init_syntax_once PARAMS ((void));
@@ -314,11 +315,13 @@ static void
init_syntax_once ()
{
register int c;
- static int done = 0;
+ static char done;
if (done)
return;
- bzero (re_syntax_table, sizeof re_syntax_table);
+
+ re_syntax_table = __uc_malloc(CHAR_SET_SIZE);
+ bzero (re_syntax_table, CHAR_SET_SIZE);
for (c = 0; c < CHAR_SET_SIZE; ++c)
if (ISALNUM (c))
diff --git a/libc/misc/ttyent/getttyent.c b/libc/misc/ttyent/getttyent.c
index c9c68f1cc..e68eb8aa0 100644
--- a/libc/misc/ttyent/getttyent.c
+++ b/libc/misc/ttyent/getttyent.c
@@ -34,6 +34,7 @@
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
+#include <malloc.h>
#ifdef __UCLIBC_HAS_THREADS__
#include <pthread.h>
#endif
@@ -132,9 +133,7 @@ struct ttyent * getttyent(void)
return (NULL);
if (!line) {
- line = malloc(BUFSIZ);
- if (!line)
- abort();
+ line = __uc_malloc(BUFSIZ);
}
__STDIO_ALWAYS_THREADLOCK(tf);