Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/strtol.c

    r42e91ae r9675296  
    245245}
    246246
    247 static inline intmax_t _strtosigned(const char *nptr, char **endptr, int base,
    248     intmax_t min, intmax_t max, errno_t *err, bool nonstd)
    249 {
    250         bool sgn = false;
    251         uintmax_t number = _strtoumax(nptr, endptr, base, &sgn, err, nonstd);
    252 
    253         if (number > (uintmax_t) max) {
    254                 if (sgn && (number - 1 == (uintmax_t) max)) {
    255                         return min;
    256                 }
    257 
    258                 *err = nonstd ? EOVERFLOW : ERANGE;
    259                 return (sgn ? min : max);
    260         }
    261 
    262         return (sgn ? -number : number);
    263 }
    264 
    265247static inline uintmax_t _strtounsigned(const char *nptr, char **endptr, int base,
    266248    uintmax_t max, errno_t *err, bool nonstd)
Note: See TracChangeset for help on using the changeset viewer.