xbps_show_pkg_info: print with %zu if humanize_number() fails.
--HG-- extra : convert_revision : 1145081289336f3d76c877b68321f5f76d559a89
This commit is contained in:
parent
d10d9e824c
commit
1282daf008
12
lib/plist.c
12
lib/plist.c
|
@ -374,6 +374,7 @@ xbps_show_pkg_info(prop_dictionary_t dict)
|
|||
prop_object_t obj;
|
||||
const char *sep = NULL;
|
||||
char size[64];
|
||||
int rv = 0;
|
||||
|
||||
assert(dict != NULL);
|
||||
if (prop_dictionary_count(dict) == 0)
|
||||
|
@ -385,10 +386,15 @@ xbps_show_pkg_info(prop_dictionary_t dict)
|
|||
|
||||
obj = prop_dictionary_get(dict, "installed_size");
|
||||
if (obj && prop_object_type(obj) == PROP_TYPE_NUMBER) {
|
||||
humanize_number(size, 5,
|
||||
printf("Installed size: ");
|
||||
rv = humanize_number(size, 5,
|
||||
(int64_t)prop_number_unsigned_integer_value(obj),
|
||||
"", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
|
||||
printf("Installed size: %s\n", size);
|
||||
"", HN_AUTOSCALE, HN_NOSPACE);
|
||||
if (rv == -1)
|
||||
printf("%zu\n",
|
||||
prop_number_unsigned_integer_value(obj));
|
||||
else
|
||||
printf("%s\n", size);
|
||||
}
|
||||
|
||||
obj = prop_dictionary_get(dict, "maintainer");
|
||||
|
|
Loading…
Reference in New Issue