X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fvsscanf.c;h=20893c97a7b6251f9c30beb49b0e766b181eddc6;hb=268c42b566c2be8deaf4c9c8571d3d2e23bae92d;hp=f33b8c418e6e9d8a12d3cbcd2ee955f9b0c85ed9;hpb=e1aa1603e598277c4c0cb560ac068ac79c4dc2eb;p=pdclib diff --git a/functions/stdio/vsscanf.c b/functions/stdio/vsscanf.c index f33b8c4..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; @@ -59,7 +52,7 @@ int vsscanf( const char * _PDCLIB_restrict s, const char * _PDCLIB_restrict form } else { - /* NULL return code indicates matching error */ + /* NULL return code indicates input error */ if ( rc == NULL ) { break;