diff options
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | src/libirecovery.c | 8 |
2 files changed, 2 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 7e8c7ea..d136f93 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -41,7 +41,7 @@ AC_TYPE_UINT32_T | |||
| 41 | AC_TYPE_UINT8_T | 41 | AC_TYPE_UINT8_T |
| 42 | 42 | ||
| 43 | # Checks for library functions. | 43 | # Checks for library functions. |
| 44 | AC_CHECK_FUNCS([strdup strerror strndup malloc realloc calloc]) | 44 | AC_CHECK_FUNCS([strdup strerror strcasecmp strndup malloc realloc calloc]) |
| 45 | 45 | ||
| 46 | # Checks for libraries. | 46 | # Checks for libraries. |
| 47 | AC_CHECK_HEADERS([readline/readline.h], [], | 47 | AC_CHECK_HEADERS([readline/readline.h], [], |
diff --git a/src/libirecovery.c b/src/libirecovery.c index 1defaac..2219f36 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -3271,14 +3271,8 @@ IRECV_API irecv_error_t irecv_devices_get_device_by_hardware_model(const char* h | |||
| 3271 | 3271 | ||
| 3272 | *device = NULL; | 3272 | *device = NULL; |
| 3273 | 3273 | ||
| 3274 | /* lowercase hardware_model string for proper lookup */ | ||
| 3275 | char model[8]; | ||
| 3276 | strcpy(model, hardware_model); | ||
| 3277 | char *p = model; | ||
| 3278 | for (; *p; ++p) *p = tolower(*p); | ||
| 3279 | |||
| 3280 | for (i = 0; irecv_devices[i].hardware_model != NULL; i++) { | 3274 | for (i = 0; irecv_devices[i].hardware_model != NULL; i++) { |
| 3281 | if (!strcmp(model, irecv_devices[i].hardware_model)) { | 3275 | if (!strcasecmp(hardware_model, irecv_devices[i].hardware_model)) { |
| 3282 | *device = &irecv_devices[i]; | 3276 | *device = &irecv_devices[i]; |
| 3283 | return IRECV_E_SUCCESS; | 3277 | return IRECV_E_SUCCESS; |
| 3284 | } | 3278 | } |
