-/* $Id$ */
-
/* _PDCLIB_scan( const char *, struct _PDCLIB_status_t * )
This file is part of the Public Domain C Library (PDCLib).
#ifndef REGTEST
+#include "_PDCLIB_io.h"
+
/* Using an integer's bits as flags for both the conversion flags and length
modifiers.
*/
const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status )
{
/* generic input character */
- int rc;
+ int rc = EOF;
const char * orig_spec = spec;
if ( *(++spec) == '%' )
{
{
char * c = va_arg( status->arg, char * );
/* for %c, default width is one */
- if ( status->width == SIZE_MAX )
+ if ( status->width == UINT_MAX )
{
status->width = 1;
}
case 's':
{
char * c = va_arg( status->arg, char * );
- while ( ( status->current < status->width ) &&
+ while ( ( status->current < status->width ) &&
( ( rc = GET( status ) ) != EOF ) )
{
if ( isspace( rc ) )
} while ( *endspec != ']' );
// read according to scanlist, equiv. to %s above
char * c = va_arg( status->arg, char * );
- while ( ( status->current < status->width ) &&
+ while ( ( status->current < status->width ) &&
( ( rc = GET( status ) ) != EOF ) )
{
if ( negative_scanlist )