diff options
author | Cy Schubert <cy@FreeBSD.org> | 2024-05-10 15:15:56 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2024-05-26 22:55:52 +0000 |
commit | 1f833b3fc9968c3dd7ed79ccf0525ebf16c891ad (patch) | |
tree | 85801af20e3b694584668aeb39ecec75ee71f72c /libntp/vint64ops.c | |
parent | ab1f1aa8333369a83ff284848fc3fc2e52d5f29f (diff) |
Diffstat (limited to 'libntp/vint64ops.c')
-rw-r--r-- | libntp/vint64ops.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libntp/vint64ops.c b/libntp/vint64ops.c index 1d5087d95438..23c9f26dcfac 100644 --- a/libntp/vint64ops.c +++ b/libntp/vint64ops.c @@ -15,24 +15,25 @@ #include "ntp_types.h" #include "ntp_fp.h" +#include "ntp_malloc.h" #include "vint64ops.h" /* -------------------------------------------------------------------------*/ vint64 strtouv64( - char const * begp, - char const ** const endp, - int base + char * begp, + char ** endp, + int base ) { - vint64 res; - u_char digit; - int sig, num; - const u_char *src; + vint64 res; + u_char digit; + int sig, num; + u_char *src; num = sig = 0; - src = (const u_char*)begp; + src = (u_char *)begp; while (isspace(*src)) src++; @@ -61,7 +62,7 @@ strtouv64( return res; } - memset(&res, 0, sizeof(res)); + ZERO(res); while (*src) { if (isdigit(*src)) digit = *src - '0'; @@ -97,7 +98,7 @@ strtouv64( if (!num) errno = EINVAL; if (endp) - *endp = (const char *)src; + *endp = (char *)src; if (sig) M_NEG(res.D_s.hi, res.D_s.lo); return res; |