X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdlib%2Fstrtoul.c;h=7bd8488feaae1cc80932d2b71ec98c232f27f205;hb=91af4888664608e3f47420110ed642c8d2dfc506;hp=d283efba8aa10cf235a91c7a65fc5339a8adabcc;hpb=d02f38605b53cdff5460cc6b9e1b2a80c3a2ba4c;p=pdclib diff --git a/functions/stdlib/strtoul.c b/functions/stdlib/strtoul.c index d283efb..7bd8488 100644 --- a/functions/stdlib/strtoul.c +++ b/functions/stdlib/strtoul.c @@ -1,7 +1,5 @@ /* $Id$ */ -/* Release $Name$ */ - /* strtoul( const char *, char * *, int ) This file is part of the Public Domain C Library (PDCLib). @@ -21,7 +19,7 @@ unsigned long int strtoul( const char * s, char ** endptr, int base ) char sign = '+'; const char * p = _PDCLIB_strtox_prelim( s, &sign, &base ); if ( base < 2 || base > 36 ) return 0; - rc = _PDCLIB_strtox_main( &p, (unsigned)base, (uintmax_t)ULONG_MAX, (uintmax_t)( ULONG_MAX / base ), (uintmax_t)( ULONG_MAX % base ), &sign ); + rc = (unsigned long int)_PDCLIB_strtox_main( &p, (unsigned)base, (uintmax_t)ULONG_MAX, (uintmax_t)( ULONG_MAX / base ), (int)( ULONG_MAX % base ), &sign ); if ( endptr != NULL ) *endptr = ( p != NULL ) ? (char *) p : (char *) s; return ( sign == '+' ) ? rc : -rc; }