summaryrefslogtreecommitdiff
path: root/package/tinc/patches/patch-src_linux_device_c
blob: 9a5c09059f7c1b4cde8dd6a952cb70c298655083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- tinc-1.0.11.orig/src/linux/device.c	2009-09-27 12:27:54.000000000 +0200
+++ tinc-1.0.11/src/linux/device.c	2009-12-06 02:30:32.000000000 +0100
@@ -61,7 +61,7 @@ bool setup_device(void) {
 		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);
 
@@ -105,7 +105,7 @@ bool setup_device(void) {
 		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);