From 5ea2a1845f3393e91d6d102a8a89f339dd24f467 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 23 Nov 2020 23:09:18 -0800 Subject: fixes #1358 nni_strtou64 and nni_strtox64 could be replaced with strtoull --- src/transport/zerotier/zerotier.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/transport') diff --git a/src/transport/zerotier/zerotier.c b/src/transport/zerotier/zerotier.c index c66a4b2c..896add29 100644 --- a/src/transport/zerotier/zerotier.c +++ b/src/transport/zerotier/zerotier.c @@ -1521,12 +1521,14 @@ zt_walk_moons(const char *path, void *arg) { zt_node * ztn = arg; const char *bn = nni_file_basename(path); + char * end; uint64_t moonid; if (strncmp(bn, "moon.", 5) != 0) { return (NNI_FILE_WALK_CONTINUE); } - if (nni_strtox64(bn + 5, &moonid) == 0) { + if (((moonid = (uint64_t) strtoull(bn + 5, &end, 16)) != 0) && + (*end == '\0')) { ZT_Node_orbit(ztn->zn_znode, NULL, moonid, 0); } return (NNI_FILE_WALK_CONTINUE); -- cgit v1.2.3-70-g09d2