summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libstdio/fprintf.c
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2003-08-20 07:37:27 +0000
committerMystery Man <unknown@mandriva.org>2003-08-20 07:37:27 +0000
commit7f2ac73888b8ef372ea597049981b27e7d810ac2 (patch)
tree354132889b63bbe5f446cb82869b3c3367135a80 /mdk-stage1/dietlibc/libstdio/fprintf.c
parent327bd24f8e4291bd1882de1990dd7339f781a9cb (diff)
downloaddrakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.tar
drakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.tar.gz
drakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.tar.bz2
drakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.tar.xz
drakx-7f2ac73888b8ef372ea597049981b27e7d810ac2.zip
This commit was manufactured by cvs2svn to create branch 'MDKC_1_0'.topic/MDKC_1_0
Diffstat (limited to 'mdk-stage1/dietlibc/libstdio/fprintf.c')
-rw-r--r--mdk-stage1/dietlibc/libstdio/fprintf.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/mdk-stage1/dietlibc/libstdio/fprintf.c b/mdk-stage1/dietlibc/libstdio/fprintf.c
index 237fd1e51..6b3849a33 100644
--- a/mdk-stage1/dietlibc/libstdio/fprintf.c
+++ b/mdk-stage1/dietlibc/libstdio/fprintf.c
@@ -1,23 +1,13 @@
#include <stdarg.h>
-#include <linux/types.h>
+#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
-extern int vsnprintf (char *str,size_t size,const char *format, va_list arg_ptr);
-
int fprintf(FILE *f,const char *format,...) {
int n;
- char *printf_buf;
-/* char printf_buf[1024]; */
va_list arg_ptr;
- va_start(arg_ptr, format);
- n=vsnprintf(0,1000000,format,arg_ptr);
-/* write(1,printf_buf,strlen(printf_buf)); */
- va_end (arg_ptr);
- va_start (arg_ptr, format);
- printf_buf=alloca(n+2);
- n=vsnprintf(printf_buf,n+1,format,arg_ptr);
- va_end (arg_ptr);
- fwrite(printf_buf,n,1,f);
+ va_start(arg_ptr,format);
+ n=vfprintf(f,format,arg_ptr);
+ va_end(arg_ptr);
return n;
}