Lines Matching refs:nptr
510 static inline void FixRealStrtolEndptr(const char *nptr, char **endptr) {
512 if (nptr == *endptr) {
516 while (IsSpace(*nptr)) nptr++;
517 if (*nptr == '+' || *nptr == '-') nptr++;
518 *endptr = (char*)nptr;
520 CHECK(*endptr >= nptr);
523 INTERCEPTOR(long, strtol, const char *nptr, // NOLINT
527 return REAL(strtol)(nptr, endptr, base);
530 long result = REAL(strtol)(nptr, &real_endptr, base); // NOLINT
535 FixRealStrtolEndptr(nptr, &real_endptr);
536 ASAN_READ_RANGE(nptr, (real_endptr - nptr) + 1);
541 INTERCEPTOR(int, atoi, const char *nptr) {
543 if (!asan_inited) return REAL(atoi)(nptr);
547 return REAL(atoi)(nptr);
550 // "man atoi" tells that behavior of atoi(nptr) is the same as
551 // strtol(nptr, 0, 10), i.e. it sets errno to ERANGE if the
554 int result = REAL(strtol)(nptr, &real_endptr, 10);
555 FixRealStrtolEndptr(nptr, &real_endptr);
556 ASAN_READ_RANGE(nptr, (real_endptr - nptr) + 1);
560 INTERCEPTOR(long, atol, const char *nptr) { // NOLINT
562 if (!asan_inited) return REAL(atol)(nptr);
566 return REAL(atol)(nptr);
569 long result = REAL(strtol)(nptr, &real_endptr, 10); // NOLINT
570 FixRealStrtolEndptr(nptr, &real_endptr);
571 ASAN_READ_RANGE(nptr, (real_endptr - nptr) + 1);
576 INTERCEPTOR(long long, strtoll, const char *nptr, // NOLINT
580 return REAL(strtoll)(nptr, endptr, base);
583 long long result = REAL(strtoll)(nptr, &real_endptr, base); // NOLINT
591 FixRealStrtolEndptr(nptr, &real_endptr);
592 ASAN_READ_RANGE(nptr, (real_endptr - nptr) + 1);
597 INTERCEPTOR(long long, atoll, const char *nptr) { // NOLINT
600 return REAL(atoll)(nptr);
603 long long result = REAL(strtoll)(nptr, &real_endptr, 10); // NOLINT
604 FixRealStrtolEndptr(nptr, &real_endptr);
605 ASAN_READ_RANGE(nptr, (real_endptr - nptr) + 1);