X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdlib%2Fstrtoll.c;fp=functions%2Fstdlib%2Fstrtoll.c;h=aa91163842a09bc4923a64c95a1e65333d9c49d2;hb=0d54a75af25ca44411e7c4190cc2a93a390e61a2;hp=0eb8423f609c5246294f53e865a38df4e8f2af46;hpb=18af9d0a4cd252433e0cbd5daf4640e325c9d0ab;p=pdclib.old diff --git a/functions/stdlib/strtoll.c b/functions/stdlib/strtoll.c index 0eb8423..aa91163 100644 --- a/functions/stdlib/strtoll.c +++ b/functions/stdlib/strtoll.c @@ -21,13 +21,13 @@ long long int strtoll( const char * s, char ** endptr, int base ) if ( base < 2 || base > 36 ) return 0; if ( sign == '+' ) { - rc = _PDCLIB_strtox_main( &p, (unsigned)base, (uintmax_t)LLONG_MAX, (uintmax_t)( LLONG_MAX / base ), (int)( LLONG_MAX % base ), &sign ); + rc = (long long int)_PDCLIB_strtox_main( &p, (unsigned)base, (uintmax_t)LLONG_MAX, (uintmax_t)( LLONG_MAX / base ), (int)( LLONG_MAX % base ), &sign ); } else { /* FIXME: This breaks on some machines that round negatives wrongly */ /* FIXME: Sign error not caught by testdriver */ - rc = _PDCLIB_strtox_main( &p, (unsigned)base, (uintmax_t)LLONG_MIN, (uintmax_t)( LLONG_MIN / -base ), (int)( -( LLONG_MIN % base ) ), &sign ); + rc = (long long int)_PDCLIB_strtox_main( &p, (unsigned)base, (uintmax_t)LLONG_MIN, (uintmax_t)( LLONG_MIN / -base ), (int)( -( LLONG_MIN % base ) ), &sign ); } if ( endptr != NULL ) *endptr = ( p != NULL ) ? (char *) p : (char *) s; return ( sign == '+' ) ? rc : -rc;