~ubuntu-branches/ubuntu/gutsy/avr-libc/gutsy

« back to all changes in this revision

Viewing changes to libc/stdio/sscanf_p.c

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2006-05-01 12:03:39 UTC
  • mto: (3.1.1 edgy)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060501120339-q93dxulpunby36dj
Tags: upstream-1.4.4
ImportĀ upstreamĀ versionĀ 1.4.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
  POSSIBILITY OF SUCH DAMAGE.
28
28
*/
29
29
 
30
 
/* $Id: sscanf_p.c,v 1.1 2003/01/07 22:17:24 joerg_wunsch Exp $ */
 
30
/* $Id: sscanf_p.c,v 1.2 2005/08/17 14:00:56 joerg_wunsch Exp $ */
31
31
 
32
32
#include <limits.h>
33
33
#include <stdarg.h>
43
43
        int i;
44
44
 
45
45
        f.flags = __SRD | __SSTR | __SPGM;
46
 
        f.buf = s;
 
46
        /*
 
47
         * It is OK to discard the "const" qualifier here.  f.buf is
 
48
         * non-const as in the generic case, this buffer is obtained
 
49
         * by malloc().  In the scanf case however, the buffer is
 
50
         * really only be read (by getc()), and as this our FILE f we
 
51
         * be discarded upon exiting sscanf_P(), nobody will ever get
 
52
         * a chance to get write access to it again.
 
53
         */
 
54
        f.buf = (char *)s;
47
55
        va_start(ap, fmt);
48
56
        i = vfscanf(&f, fmt, ap);
49
57
        va_end(ap);