From 8084f68b5063eaf2a619c603f0d0418d8bfbfd64 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Fri, 23 Nov 2012 22:08:45 +0100 Subject: local: Fix device detection --- src/local.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'src/local.c') diff --git a/src/local.c b/src/local.c index 04503eb..091d71a 100644 --- a/src/local.c +++ b/src/local.c @@ -75,28 +75,18 @@ int local_init(void) { --ptr2; } - if ( strcmp(ptr, "Nokia 770") == 0 ) { + if ( strcmp(ptr, "Nokia 770") == 0 ) device = DEVICE_SU_18; - printf("Found local device: %s\n", device_to_long_string(device)); - fclose(file); - return 0; - } else if ( strcmp(ptr, "Nokia N800") == 0 ) { + else if ( strcmp(ptr, "Nokia N800") == 0 ) device = DEVICE_RX_34; - printf("Found local device: %s\n", device_to_long_string(device)); - fclose(file); - return 0; - } else if ( strcmp(ptr, "Nokia N810") == 0 ) { + else if ( strcmp(ptr, "Nokia N810") == 0 ) device = DEVICE_RX_44; - printf("Found local device: %s\n", device_to_long_string(device)); - fclose(file); - return 0; - } else if ( strcmp(ptr, "Nokia N810 WiMAX") == 0 ) { + else if ( strcmp(ptr, "Nokia N810 WiMAX") == 0 ) device = DEVICE_RX_48; - printf("Found local device: %s\n", device_to_long_string(device)); - fclose(file); - return 0; - } else if ( strcmp(ptr, "Nokia RX-51 board") == 0) { + else if ( strcmp(ptr, "Nokia RX-51 board") == 0 ) device = DEVICE_RX_51; + + if ( device ) { printf("Found local device: %s\n", device_to_long_string(device)); fclose(file); return 0; -- cgit v1.2.3