summaryrefslogtreecommitdiff
path: root/src/libbiguint/bu_scanlen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libbiguint/bu_scanlen.c')
-rw-r--r--src/libbiguint/bu_scanlen.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libbiguint/bu_scanlen.c b/src/libbiguint/bu_scanlen.c
new file mode 100644
index 0000000..88c6aee
--- /dev/null
+++ b/src/libbiguint/bu_scanlen.c
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#include <skalibs/fmtscan.h>
+#include <skalibs/biguint.h>
+
+unsigned int bu_scanlen (char const *s, unsigned int *zeron)
+{
+ unsigned int n = ucharn_findlen(s) ;
+ *zeron = n ;
+ while (*s == '0') { s++ ; (*zeron)-- ; }
+ return n ;
+}