X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fsubnet.c;h=daefc2f5a2390e7ff34eda51a83df8a23e4c9c76;hp=bc66fecccdf69ab2d1dfaa5151f1484254adab96;hb=5d194b9f8767390d9fb1170554a8b6928214957a;hpb=b45511118421920771f5dcd5e4bafc04376e4450 diff --git a/src/subnet.c b/src/subnet.c index bc66fecc..daefc2f5 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -478,7 +478,7 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { if(!net2str(netstr, sizeof netstr, subnet)) continue; // Strip the weight from the subnet, and put it in its own environment variable - char *weight = strchr(netstr + 7, '#'); + char *weight = strchr(netstr, '#'); if(weight) *weight++ = 0; else @@ -495,9 +495,9 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { execute_script(name, envp); } } else { - if(net2str(netstr + 7, sizeof netstr - 7, subnet)) { + if(net2str(netstr, sizeof netstr, subnet)) { // Strip the weight from the subnet, and put it in its own environment variable - char *weight = strchr(netstr + 7, '#'); + char *weight = strchr(netstr, '#'); if(weight) *weight++ = 0; else