chiark / gitweb /
cleanup: buffer size for snprintf should come from sizeof
[secnet.git] / tun.c
diff --git a/tun.c b/tun.c
index d899f0c6d006219573fc60ef6e3f43943e4ba032..5f9aa98d1051c5ae4d43ba32e6aa1768fa356447 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -332,7 +332,7 @@ static void tun_phase_hook(void *sst, uint32_t newphase)
 
     hostaddr=ipaddr_to_string(st->local_address);
     secnetaddr=ipaddr_to_string(st->nl.secnet_address);
-    snprintf(mtu,6,"%d",st->nl.mtu);
+    snprintf(mtu,sizeof(mtu),"%d",st->nl.mtu);
     mtu[5]=0;
 
     switch (st->ifconfig_type) {