src/lib/ppc405lib/strtox.c
/// See documentation for the file strtox.c
See documentation for the file strtox.c
See documentation for the file strtox . c
int
_strtoul(const char* str, char** endptr, int base, unsigned long* value)
{
    int rc, negative, overflow;
    unsigned long long value_ull;
    rc = strtox(str, endptr, base, &value_ull, &negative, &overflow);
    if (rc) {
        *value = 0;
    } else {
        if (overflow || (value_ull != (unsigned long)value_ull)) {
            rc = STRTOX_OVERFLOW_STRTOUL;
            *value = ULONG_MAX;
        } else {
            *value = value_ull;
            if (negative) {
                *value = ~*value + 1;
            }
        }
    }
    return rc;
}
int _strtoul ( const char * str , char * * endptr , int base , unsigned long * value ) { int rc , negative , overflow ; unsigned long long value_ull ; rc = strtox ( str , endptr , base , & value_ull , & negative , & overflow ) ; if ( rc ) { * value = 0 ; } else { if ( overflow || ( value_ull != ( unsigned long ) value_ull ) ) { rc = STRTOX_OVERFLOW_STRTOUL ; * value = ULONG_MAX ; } else { * value = value_ull ; if ( negative ) { * value = ~ * value + 1 ; } } } return rc ; }
See documentation for the file strtox.c
See documentation for the file strtox . c