summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libstdio/fprintf.c
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-18 16:48:11 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-18 16:48:11 +0000
commit8182e7cfe7d9c60567e48b876282594395062530 (patch)
treebb743948c6e926539b030102b804b5708222e8d4 /mdk-stage1/dietlibc/libstdio/fprintf.c
parentc93f95560d3fde9eaefcc62c454c67b8b5626fa7 (diff)
downloaddrakx-backup-do-not-use-8182e7cfe7d9c60567e48b876282594395062530.tar
drakx-backup-do-not-use-8182e7cfe7d9c60567e48b876282594395062530.tar.gz
drakx-backup-do-not-use-8182e7cfe7d9c60567e48b876282594395062530.tar.bz2
drakx-backup-do-not-use-8182e7cfe7d9c60567e48b876282594395062530.tar.xz
drakx-backup-do-not-use-8182e7cfe7d9c60567e48b876282594395062530.zip
Merge in CVS dietlibc 0.21 for IA-64 and X86-64 support. However, drop the
following architectures we currently don't support: arm, mips, mipsel, parisc, s390, sparc64.
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;
}