Permalink
Browse files

allow alignment for %! token

  • Loading branch information...
falconindy committed Aug 22, 2011
1 parent a099ff1 commit 3cf25f8f431d5abf0557a7c56c10399637613639
Showing with 3 additions and 2 deletions.
  1. +3 −2 expac.c
View
@@ -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));

0 comments on commit 3cf25f8

Please sign in to comment.