From 88483db112b15569aad4898d30a8ab7ea4deb96b Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 30 Jul 2007 17:02:06 +0000 Subject: make regex_old.c, ruserpass.c use __uc_malloc, replace "buf = malloc(BUFSIZ); if (!buf) abort();" by __uc_malloc elsewhere. With last 7 patches together uclibc has 3k of static data total with fairly big .config and with 2k being used for 2 x BUFSIZ stdio buffer: text data bss dec hex filename 114 132 2048 2294 8f6 _stdio.o (ex lib/libc.a) total data 593 total bss 3062 --- libc/inet/rpc/ruserpass.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libc/inet/rpc/ruserpass.c') diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c index 0adcbf1d3..b18bbf5b7 100644 --- a/libc/inet/rpc/ruserpass.c +++ b/libc/inet/rpc/ruserpass.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -79,7 +80,7 @@ static FILE *cfile; #define ID 10 #define MACHINE 11 -static char tokval[100]; +static char *tokval; /* [100] */ static const char tokstr[] = { @@ -152,6 +153,9 @@ int ruserpass(const char *host, const char **aname, const char **apass) if (mydomain==NULL) { mydomain=myname + strlen(myname); } + + if (!tokval) + tokval = __uc_malloc(100); next: while ((t = token())) switch(t) { -- cgit v1.2.3