X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsubnet_parse.c;h=5b0b4822eed56d862aeef1ff3de35b94878d714b;hb=23a22ea1ceb9d0a6b6c288142130f0e30c0fdec9;hp=592283117f8df39cf1e18f0ab9209526249fbeb1;hpb=163773d7107b7726bed24cb1c31b1cecc0d0c239;p=tinc diff --git a/src/subnet_parse.c b/src/subnet_parse.c index 59228311..5b0b4822 100644 --- a/src/subnet_parse.c +++ b/src/subnet_parse.c @@ -262,10 +262,11 @@ bool str2net(subnet_t *subnet, const char *subnetstr) { if (double_colon) { /* Figure out how many zero groups we need to expand */ int zero_group_count = 8; - for (const char* cur = str; *cur; *cur && cur++) + for (const char* cur = str; *cur; cur++) if (*cur != ':') { zero_group_count--; - for (; *cur && *cur != ':'; cur++); + while(cur[1] && cur[1] != ':') + cur++; } if (zero_group_count < 1) return false; @@ -319,8 +320,7 @@ bool net2str(char *netstr, int len, const subnet_t *subnet) { subnet->net.mac.address.x[2], subnet->net.mac.address.x[3], subnet->net.mac.address.x[4], - subnet->net.mac.address.x[5], - subnet->weight); + subnet->net.mac.address.x[5]); netstr += result; len -= result; break;