ltunify: fix device type validation

This commit is contained in:
Peter Wu
2013-04-25 12:25:14 +02:00
parent 98f9432088
commit 7a1643e6fa

View File

@@ -952,7 +952,7 @@ static int validate_args(int argc, char **argv, char ***args, char **hidraw_path
return -1;
}
device_index = strtoul((*args)[1], &end, 0);
if (end != '\0') {
if (*end != '\0') {
if (device_type_from_str((*args)[1]) == -1) {
fprintf(stderr, "Invalid device type. Valid types are:\n");
print_device_types();