diff options
author | Xin LI <delphij@FreeBSD.org> | 2016-01-21 08:50:56 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2016-01-21 08:50:56 +0000 |
commit | cbb26d1b6673ba1c6efd6e36a06fb6a56263b5fc (patch) | |
tree | 72c8a10ba42f04018a461504b789125f97944bda /sntp/libopts/parse-duration.c | |
parent | c373d9289d1987abe45e339b5aa37f05460e977f (diff) |
Notes
Diffstat (limited to 'sntp/libopts/parse-duration.c')
-rw-r--r-- | sntp/libopts/parse-duration.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sntp/libopts/parse-duration.c b/sntp/libopts/parse-duration.c index e072b7d567f5..11e3d828d897 100644 --- a/sntp/libopts/parse-duration.c +++ b/sntp/libopts/parse-duration.c @@ -60,14 +60,20 @@ typedef enum { static unsigned long str_const_to_ul (cch_t * str, cch_t ** ppz, int base) { - return strtoul (str, (char **)ppz, base); + char * pz; + int rv = strtoul (str, &pz, base); + *ppz = pz; + return rv; } /* Wrapper around strtol that does not require a cast. */ static long str_const_to_l (cch_t * str, cch_t ** ppz, int base) { - return strtol (str, (char **)ppz, base); + char * pz; + int rv = strtol (str, &pz, base); + *ppz = pz; + return rv; } /* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME |