summaryrefslogtreecommitdiff
path: root/extras/usb_id/usb_id.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-08-22 11:37:12 +0200
committerKay Sievers <kay.sievers@suse.de>2005-08-22 11:37:12 +0200
commitc907c823c388dfbdfa7054cfb2f4e9b92eb31e2e (patch)
tree88bc34b0f6ce8e5fdcec9f0a31bd6d4651285835 /extras/usb_id/usb_id.c
parent8c11a2f0ff27264513033691bb818262f009fe4e (diff)
*_id: fix zero length in set_str()
Thanks to Olaf Hering <olh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'extras/usb_id/usb_id.c')
-rw-r--r--extras/usb_id/usb_id.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extras/usb_id/usb_id.c b/extras/usb_id/usb_id.c
index f5ee795924..c4ce0c6103 100644
--- a/extras/usb_id/usb_id.c
+++ b/extras/usb_id/usb_id.c
@@ -82,7 +82,7 @@ static void set_str(char *to, const char *from, size_t count)
/* strip trailing whitespace */
len = strnlen(from, count);
- while (isspace(from[len-1]))
+ while (len && isspace(from[len-1]))
len--;
/* strip leading whitespace */