File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -314,23 +314,6 @@ device_desc get_device_desc(CFStringRef model) {
314
314
return res;
315
315
}
316
316
317
- char * MYCFStringCopyUTF8String (CFStringRef aString) {
318
- if (aString == NULL ) {
319
- return NULL ;
320
- }
321
-
322
- CFIndex length = CFStringGetLength (aString);
323
- CFIndex maxSize =
324
- CFStringGetMaximumSizeForEncoding (length,
325
- kCFStringEncodingUTF8 );
326
- char *buffer = (char *)malloc (maxSize);
327
- if (CFStringGetCString (aString, buffer, maxSize,
328
- kCFStringEncodingUTF8 )) {
329
- return buffer;
330
- }
331
- return NULL ;
332
- }
333
-
334
317
CFStringRef get_device_full_name (const AMDeviceRef device) {
335
318
CFStringRef full_name = NULL ,
336
319
device_udid = AMDeviceCopyDeviceIdentifier (device),
@@ -1540,7 +1523,8 @@ void handle_device(AMDeviceRef device) {
1540
1523
return ;
1541
1524
}
1542
1525
} else {
1543
- device_id = MYCFStringCopyUTF8String (found_device_id);
1526
+ // Use the first device we find if a device_id wasn't specified.
1527
+ device_id = strdup (CFStringGetCStringPtr (found_device_id, kCFStringEncodingUTF8 ));
1544
1528
found_device = true ;
1545
1529
}
1546
1530
You can’t perform that action at this time.
0 commit comments