[PATCH 04/12] libusbg: Fix off-by-one error.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
---
 src/usbg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/usbg.c b/src/usbg.c
index d2ec246..f12a4b3 100644
--- a/src/usbg.c
+++ b/src/usbg.c
@@ -319,7 +319,7 @@ static int usbg_lookup_function_type(const char *name)
 
 const const char *usbg_get_function_type_str(usbg_function_type type)
 {
-	return type > 0 && type < sizeof(function_names)/sizeof(char *) ?
+	return type >= 0 && type < sizeof(function_names)/sizeof(char *) ?
 			function_names[type] : NULL;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux