This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
sprintf question
- From: Robin Getz <rgetz at blackfin dot uclinux dot org>
- To: newlib at sourceware dot org
- Date: Wed, 28 Feb 2007 10:36:46 -0500
- Subject: sprintf question
All:
I was trying to use something like:
================
int i=0;
char buff[100];
sprintf(buff,"%i\n", i);
==========
It seems that sprintf, in libc/stdio/sprintf.c calls _vfprintf_r, which needs
<<close>>, <<fstat>>, <<isatty>>, <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
I thought it strange, that operations purely on a buffer, would require
supporting OS file subroutines. I can understand why these are necessary for
printf, fprintf, but why sprintf?
Can someone explain?
Thanks
-Robin