Skip to content

Commit fc32f82

Browse files
committed
Use plist_write_to_stream to print app list
1 parent baa9b5d commit fc32f82

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/ideviceinstaller.c

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -170,27 +170,7 @@ static void print_apps(plist_t apps)
170170
if (!strcmp(key, "CFBundleIdentifier")) {
171171
printf("%s", plist_get_string_ptr(node, NULL));
172172
} else {
173-
uint64_t uval = 0;
174-
switch (plist_get_node_type(node)) {
175-
case PLIST_STRING:
176-
printf("\"%s\"", plist_get_string_ptr(node, NULL));
177-
break;
178-
case PLIST_INT:
179-
plist_get_uint_val(node, &uval);
180-
printf("%" PRIu64, uval);
181-
break;
182-
case PLIST_BOOLEAN:
183-
printf("%s", plist_bool_val_is_true(node) ? "true" : "false");
184-
break;
185-
case PLIST_ARRAY:
186-
printf("(array)");
187-
break;
188-
case PLIST_DICT:
189-
printf("(dict)");
190-
break;
191-
default:
192-
break;
193-
}
173+
plist_write_to_stream(node, stdout, PLIST_FORMAT_PRINT, PLIST_OPT_NO_NEWLINE);
194174
}
195175
}
196176
}

0 commit comments

Comments
 (0)