libzpool: fix ddi_strtoull to update nptr

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Charles Suh <charles.suh@gmail.com>
Closes #14360
This commit is contained in:
Charles Suh 2023-01-09 12:49:35 -08:00 committed by GitHub
parent 5091867ee6
commit 44a78c05b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -770,10 +770,8 @@ random_get_pseudo_bytes(uint8_t *ptr, size_t len)
int int
ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result) ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result)
{ {
(void) nptr; errno = 0;
char *end; *result = strtoull(str, nptr, base);
*result = strtoull(str, &end, base);
if (*result == 0) if (*result == 0)
return (errno); return (errno);
return (0); return (0);