diff options
Diffstat (limited to 'src/libstddjb/int16_scan.c')
-rw-r--r-- | src/libstddjb/int16_scan.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libstddjb/int16_scan.c b/src/libstddjb/int16_scan.c index b20523d..a8e7e55 100644 --- a/src/libstddjb/int16_scan.c +++ b/src/libstddjb/int16_scan.c @@ -1,6 +1,13 @@ /* ISC license. */ -#include "fmtscan-internal.h" #include <skalibs/uint16.h> +#include <skalibs/uint64.h> +#include "fmtscan-internal.h" -SCANS(16) +size_t int16_scan_base (char const *s, int16_t *d, uint8_t base) +{ + int64_t dd ; + size_t pos = int64_scan_base_max(s, &dd, base, UINT16_MAX) ; + if (pos) *d = (uint16_t)dd ; + return pos ; +} |