diff options
Diffstat (limited to 'src/libstddjb/uint16_scan.c')
-rw-r--r-- | src/libstddjb/uint16_scan.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libstddjb/uint16_scan.c b/src/libstddjb/uint16_scan.c index 4c0564e..4b23e64 100644 --- a/src/libstddjb/uint16_scan.c +++ b/src/libstddjb/uint16_scan.c @@ -1,6 +1,13 @@ /* ISC license. */ -#include "fmtscan-internal.h" #include <skalibs/uint16.h> +#include <skalibs/uint64.h> +#include "fmtscan-internal.h" -SCANB(16) +size_t uint16_scan_base (char const *s, uint16_t *u, uint8_t base) +{ + uint64_t uu ; + size_t pos = uint64_scan_base_max(s, &uu, base, UINT16_MAX) ; + if (pos) *u = (uint16_t)uu ; + return pos ; +} |