X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fvsscanf.c;h=20893c97a7b6251f9c30beb49b0e766b181eddc6;hb=268c42b566c2be8deaf4c9c8571d3d2e23bae92d;hp=fd35889ab4d200ead2782f2a1e732c9b76fc97a7;hpb=5522316811fdce2216c4d1320af68dd54909aed5;p=pdclib diff --git a/functions/stdio/vsscanf.c b/functions/stdio/vsscanf.c index fd35889..20893c9 100644 --- a/functions/stdio/vsscanf.c +++ b/functions/stdio/vsscanf.c @@ -14,17 +14,10 @@ int vsscanf( const char * _PDCLIB_restrict s, const char * _PDCLIB_restrict format, va_list arg ) { - struct _PDCLIB_status_t status; - status.base = 0; - status.flags = 0; - status.n = 0; - status.i = 0; - status.this = 0; - status.s = (char *)s; - status.width = 0; - status.prec = 0; - status.stream = NULL; + /* base, flag, n, i, current, s, width, prec, stream, arg */ + struct _PDCLIB_status_t status = { 0, 0, 0, 0, 0, (char *)s, 0, 0, NULL, NULL }; va_copy( status.arg, arg ); + while ( *format != '\0' ) { const char * rc; @@ -62,11 +55,6 @@ int vsscanf( const char * _PDCLIB_restrict s, const char * _PDCLIB_restrict form /* NULL return code indicates input error */ if ( rc == NULL ) { - if ( status.n == 0 ) - { - /* input error before any conversion returns EOF */ - status.n = EOF; - } break; } /* Continue parsing after conversion specifier */