summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-08-07 20:17:50 -0400
committerDave Reisner <dreisner@archlinux.org>2011-08-07 20:17:50 -0400
commit919fa1c88bcfc2db16410afb084b338540e91c4f (patch)
treeedb8e4d525ad734f56fb2609aebf8a25786300c5
parentfb8bdc687264eccbff3801145871a4a34099f0e6 (diff)
downloadexpac-919fa1c88bcfc2db16410afb084b338540e91c4f.tar.xz
use proper suffixes for package sizes
-rw-r--r--expac.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/expac.c b/expac.c
index b14124a..09053e7 100644
--- a/expac.c
+++ b/expac.c
@@ -28,7 +28,7 @@
#include <alpm.h>
#include <ctype.h>
#include <getopt.h>
-#include <limits.h>
+/* #include <limits.h> */
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -42,6 +42,10 @@
#define FORMAT_TOKENS_SYNC "fk"
#define ESCAPE_TOKENS "\"\\abefnrtv"
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
static char const digits[] = "0123456789";
static char const printf_flags[] = "'-+ #0I";
@@ -435,10 +439,10 @@ static int print_pkg(pmpkg_t *pkg, const char *format) {
/* sizes */
case 'k': /* download size */
- out += printf("%.2f K", (float)alpm_pkg_get_size(pkg) / 1024.0);
+ out += printf("%.2f KiB", (float)alpm_pkg_get_size(pkg) / 1024.0);
break;
case 'm': /* install size */
- out += printf("%.2f K", (float)alpm_pkg_get_isize(pkg) / 1024.0);
+ out += printf("%.2f KiB", (float)alpm_pkg_get_isize(pkg) / 1024.0);
break;
/* lists */