Fixed a segv happening in non english locale

This commit is contained in:
Manickavasagam Senthil 2015-05-01 14:18:22 -04:00
parent 5690b10635
commit b72d31b816

View File

@ -1518,10 +1518,13 @@ void handle_device(AMDeviceRef device) {
return; return;
} }
if (device_id != NULL) { 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; found_device = true;
CFRelease(deviceCFSTR);
} else { } else {
fprintCFSTR(stdout, CFSTR("Skipping %@.\n"), device_full_name); fprintCFSTR(stdout, CFSTR("Skipping %@.\n"), device_full_name);
CFRelease(deviceCFSTR);
return; return;
} }
} else { } else {