X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fbsd%2Fdevice.c;h=6674abd209a23aa7763073097081114e263431ee;hp=c2cd34cb4af14f4e6fdc019c54b0d6c883984607;hb=dbf3d168b720045328d476f3b9e5f5e45b4ab6de;hpb=eda71798749e8b0abf5e8b3cbc11da82aa607f00 diff --git a/src/bsd/device.c b/src/bsd/device.c index c2cd34cb..6674abd2 100644 --- a/src/bsd/device.c +++ b/src/bsd/device.c @@ -64,7 +64,7 @@ bool setup_device(void) { device = xstrdup(DEFAULT_DEVICE); if(!get_config_string(lookup_config(config_tree, "Interface"), &iface)) - iface = xstrdup(rindex(device, '/') ? rindex(device, '/') + 1 : device); + iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device); if(get_config_string(lookup_config(config_tree, "DeviceType"), &type)) { if(!strcasecmp(type, "tun"))