diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-08-22 16:16:59 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-08-22 16:16:59 -0400 |
commit | 3cf25f8f431d5abf0557a7c56c10399637613639 (patch) | |
tree | 737b942e447fb3ee9eb89318d57d87637486e4ef /expac.c | |
parent | a099ff189a15965142f1221988f9e28f7840f09d (diff) | |
download | expac-3cf25f8f431d5abf0557a7c56c10399637613639.tar.xz |
allow alignment for %! token
Diffstat (limited to 'expac.c')
-rw-r--r-- | expac.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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)); |