summaryrefslogtreecommitdiff
path: root/lib/ip.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-02-25 23:28:36 +0100
committerMaria Matejka <mq@ucw.cz>2019-02-25 23:28:36 +0100
commit2915e711f77d68dff756babd19af8da1677c4549 (patch)
tree3fb2f8b5decbc9db40c5b9b00847dc49c0703f21 /lib/ip.c
parent99911873a196975f5221aad89ae5eac42e1330e0 (diff)
Custom number parser to speed up config parsing
The glibc's generic parser is slow due to its versatility. Specialized parsers for base-10 and base-16 are much faster and we don't use other bases.
Diffstat (limited to 'lib/ip.c')
-rw-r--r--lib/ip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ip.c b/lib/ip.c
index 9497248c..0f5a5348 100644
--- a/lib/ip.c
+++ b/lib/ip.c
@@ -245,7 +245,7 @@ ip4_pton(const char *a, ip4_addr *o)
char *d, *c = strchr(a, '.');
if (!c != !i)
return 0;
- l = strtoul(a, &d, 10);
+ l = bstrtoul(a, &d, 10);
if (((d != c) && *d) || (l > 255))
return 0;
ia = (ia << 8) | l;