From b4b7ff4b08e691656c9d77c758fc355833128ac0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Wed, 20 Jan 2016 14:01:31 -0300 Subject: Linux-libre 4.4-gnu --- tools/usb/usbip/src/usbip_detach.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools/usb/usbip/src') diff --git a/tools/usb/usbip/src/usbip_detach.c b/tools/usb/usbip/src/usbip_detach.c index 05c6d1585..9db9d21bb 100644 --- a/tools/usb/usbip/src/usbip_detach.c +++ b/tools/usb/usbip/src/usbip_detach.c @@ -47,7 +47,9 @@ static int detach_port(char *port) uint8_t portnum; char path[PATH_MAX+1]; - for (unsigned int i = 0; i < strlen(port); i++) + unsigned int port_len = strlen(port); + + for (unsigned int i = 0; i < port_len; i++) if (!isdigit(port[i])) { err("invalid port %s", port); return -1; -- cgit v1.2.3-54-g00ecf