X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdlib%2Fstrtoul.c;fp=functions%2Fstdlib%2Fstrtoul.c;h=68f790af7a44fff289c9482d2ac6e31b1f997198;hb=f93d55176e4db9edfb1840054169003bcca4d1fb;hp=415aadf3e7903c976794962dda5e4649956a4c1e;hpb=48ec56a384a70f2d7b1293db192e37f6dfaabe1e;p=pdclib diff --git a/functions/stdlib/strtoul.c b/functions/stdlib/strtoul.c index 415aadf..68f790a 100644 --- a/functions/stdlib/strtoul.c +++ b/functions/stdlib/strtoul.c @@ -19,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 = _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; }