Use strrchr() insteaad of rindex().
[oweals/tinc.git] / src / bsd / device.c
index c2cd34cb4af14f4e6fdc019c54b0d6c883984607..6674abd209a23aa7763073097081114e263431ee 100644 (file)
@@ -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"))