summaryrefslogtreecommitdiffstats
path: root/expac.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-08-22 16:16:59 -0400
committerDave Reisner <dreisner@archlinux.org>2011-08-22 16:16:59 -0400
commit3cf25f8f431d5abf0557a7c56c10399637613639 (patch)
tree737b942e447fb3ee9eb89318d57d87637486e4ef /expac.c
parenta099ff189a15965142f1221988f9e28f7840f09d (diff)
downloadexpac-3cf25f8f431d5abf0557a7c56c10399637613639.tar.xz
allow alignment for %! token
Diffstat (limited to 'expac.c')
-rw-r--r--expac.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/expac.c b/expac.c
index 9bf24f4..ad3792a 100644
--- a/expac.c
+++ b/expac.c
@@ -369,7 +369,7 @@ static int print_filelist(alpm_filelist_t *filelist) {
static int print_pkg(alpm_pkg_t *pkg, const char *format) {
const char *f, *end;
- char fmt[32];
+ char fmt[32], buf[32];
int len, out = 0;
end = rawmemchr(format, '\0');
@@ -419,7 +419,8 @@ static int print_pkg(alpm_pkg_t *pkg, const char *format) {
out += printf(fmt, alpm_pkg_get_reason(pkg) ? "dependency" : "explicit");
break;
case '!': /* result number */
- out += printf("%d", pkgcounter++);
+ snprintf(buf, 32, "%d", pkgcounter++);
+ out += printf(fmt, buf);
break;
case 'g': /* base64 gpg sig */
out += printf(fmt, alpm_pkg_get_base64_sig(pkg));