projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use strrchr() insteaad of rindex().
[tinc]
/
src
/
bsd
/
device.c
diff --git
a/src/bsd/device.c
b/src/bsd/device.c
index
c2cd34c
..
6674abd
100644
(file)
--- 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))
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(get_config_string(lookup_config(config_tree, "DeviceType"), &type)) {
if(!strcasecmp(type, "tun"))