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"))
if (netname != NULL)
iface = xstrdup(netname);
#else
- iface = xstrdup(rindex(device, '/') ? rindex(device, '/') + 1 : device);
+ iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device);
#endif
device_fd = open(device, O_RDWR | O_NONBLOCK);
device_type = DEVICE_TYPE_ETHERTAP;
if(iface)
free(iface);
- iface = xstrdup(rindex(device, '/') ? rindex(device, '/') + 1 : device);
+ iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device);
}
logger(LOG_INFO, "%s is a %s", device, device_info);