diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-02-21 23:01:11 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-02-21 23:01:11 +0000 |
commit | 841067b45e61bb8d5a1394d8bba25db1d2a23ea0 (patch) | |
tree | 76a8779a4825eef4fa8655ece532a1e34b601615 /mdk-stage1/dietlibc/lib | |
parent | 4fc11a304d40052e9515f660e144d925eff8575c (diff) | |
download | drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.tar drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.tar.gz drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.tar.bz2 drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.tar.xz drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.zip |
- fix "init" on ppc (do not use minilibc on non-i386 arch's)
- fix segfault of dietlibc-linked apps (broken va_stuff in dietlibc)
- cleanup of "init"
Diffstat (limited to 'mdk-stage1/dietlibc/lib')
-rw-r--r-- | mdk-stage1/dietlibc/lib/vfprintf.c | 10 | ||||
-rw-r--r-- | mdk-stage1/dietlibc/lib/vprintf.c | 12 |
2 files changed, 6 insertions, 16 deletions
diff --git a/mdk-stage1/dietlibc/lib/vfprintf.c b/mdk-stage1/dietlibc/lib/vfprintf.c index 0ebfd1561..03dfe87a9 100644 --- a/mdk-stage1/dietlibc/lib/vfprintf.c +++ b/mdk-stage1/dietlibc/lib/vfprintf.c @@ -4,12 +4,8 @@ int vfprintf(FILE *fstream, const char *format, va_list ap) { - char *tmp; - size_t n=vsnprintf(0, 1000000, format, ap); - tmp=alloca(n+2); - if (tmp) { - vsnprintf(tmp, n+1, format, ap); - fwrite(tmp, n,1, fstream); - } + char tmp[1000000]; + size_t n = vsnprintf(tmp, sizeof(tmp), format, ap); + fwrite(tmp, n, 1, fstream); return n; } diff --git a/mdk-stage1/dietlibc/lib/vprintf.c b/mdk-stage1/dietlibc/lib/vprintf.c index bba98419f..46ecc47a4 100644 --- a/mdk-stage1/dietlibc/lib/vprintf.c +++ b/mdk-stage1/dietlibc/lib/vprintf.c @@ -7,14 +7,8 @@ int vsnprintf (char *str,size_t size,const char *format, va_list arg_ptr); int vprintf(const char *format, va_list ap) { - int n; - char *printf_buf; -/* char printf_buf[1024]; */ - va_list temp = ap; - n=vsnprintf(0,1000000,format,temp); -/* write(1,printf_buf,strlen(printf_buf)); */ - printf_buf=alloca(n+2); - n=vsnprintf(printf_buf,n+1,format,ap); - write(1,printf_buf,n); + char tmp[1000000]; + size_t n = vsnprintf(tmp, sizeof(tmp), format, ap); + write(1, tmp, n); return n; } |