From b72d31b81651325f0c5b0754441f1a1027364612 Mon Sep 17 00:00:00 2001 From: Manickavasagam Senthil Date: Fri, 1 May 2015 14:18:22 -0400 Subject: [PATCH] Fixed a segv happening in non english locale --- ios-deploy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ios-deploy.c b/ios-deploy.c index ffabd33..988f81f 100644 --- a/ios-deploy.c +++ b/ios-deploy.c @@ -1518,10 +1518,13 @@ void handle_device(AMDeviceRef device) { return; } if (device_id != NULL) { - if(strcmp(device_id, CFStringGetCStringPtr(found_device_id, CFStringGetSystemEncoding())) == 0) { + CFStringRef deviceCFSTR = CFStringCreateWithCString(NULL, device_id, kCFStringEncodingASCII); + if (CFStringCompare(deviceCFSTR, found_device_id, kCFCompareCaseInsensitive) == kCFCompareEqualTo) { found_device = true; + CFRelease(deviceCFSTR); } else { fprintCFSTR(stdout, CFSTR("Skipping %@.\n"), device_full_name); + CFRelease(deviceCFSTR); return; } } else {