diff options
author | Maria Matejka <mq@ucw.cz> | 2019-02-25 23:28:36 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2019-02-25 23:28:36 +0100 |
commit | 2915e711f77d68dff756babd19af8da1677c4549 (patch) | |
tree | 3fb2f8b5decbc9db40c5b9b00847dc49c0703f21 /lib/ip.c | |
parent | 99911873a196975f5221aad89ae5eac42e1330e0 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |