diff options
author | 2015-05-04 06:12:55 -0400 | |
---|---|---|
committer | 2015-05-04 06:12:55 -0400 | |
commit | 7eb77555f12823a7b5763122b6817fb66eb2a89f (patch) | |
tree | 52541c02a11cb4602ab98d7a6d3b0d4bedb4aa91 /qcheck.c | |
parent | tests: qmerge: fix running in nocolor mode (diff) | |
download | portage-utils-7eb77555f12823a7b5763122b6817fb66eb2a89f.tar.gz portage-utils-7eb77555f12823a7b5763122b6817fb66eb2a89f.tar.bz2 portage-utils-7eb77555f12823a7b5763122b6817fb66eb2a89f.zip |
qcheck/qlop/qmerge/qxpak: fix spurious trailing u
The PRIu64 constant doesn't need its own "u" format as it's built in.
For qcheck, this meant we generated invalid CONTENTS when updating.
For the rest, it meant we had weird user facing output.
Take this opportunity to add a qcheck testsuite.
URL: https://bugs.gentoo.org/548262
Reported-by: Johnny Wezel <dev-jay@wezel.name>
Diffstat (limited to 'qcheck.c')
-rw-r--r-- | qcheck.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -186,7 +186,7 @@ static int qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_sta if (state->chk_hash) { const char *digest_disp; if (state->qc_update) - fprintf(fpx, "obj %s %s %"PRIu64"u\n", e->name, hashed_file, (uint64_t)st.st_mtime); + fprintf(fpx, "obj %s %s %"PRIu64"\n", e->name, hashed_file, (uint64_t)st.st_mtime); switch (hash_algo) { case HASH_MD5: digest_disp = "MD5"; break; case HASH_SHA1: digest_disp = "SHA1"; break; @@ -208,12 +208,12 @@ static int qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_sta if (state->chk_mtime) { qcprintf(" %sMTIME%s: %s", RED, NORM, e->name); if (verbose) - qcprintf(" (recorded '%"PRIu64"u' != actual '%"PRIu64"u')", (uint64_t)e->mtime, (uint64_t)st.st_mtime); + qcprintf(" (recorded '%"PRIu64"' != actual '%"PRIu64"')", (uint64_t)e->mtime, (uint64_t)st.st_mtime); qcprintf("\n"); /* This can only be an obj, dir and sym have no digest */ if (state->qc_update) - fprintf(fpx, "obj %s %s %"PRIu64"u\n", e->name, e->digest, (uint64_t)st.st_mtime); + fprintf(fpx, "obj %s %s %"PRIu64"\n", e->name, e->digest, (uint64_t)st.st_mtime); } else { --num_files; ++num_files_ignored; @@ -231,13 +231,13 @@ static int qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_sta if (state->chk_mtime) { qcprintf(" %sMTIME%s: %s", RED, NORM, e->name); if (verbose) - qcprintf(" (recorded '%"PRIu64"u' != actual '%"PRIu64"u')", + qcprintf(" (recorded '%"PRIu64"' != actual '%"PRIu64"')", (uint64_t)e->mtime, (uint64_t)st.st_mtime); qcprintf("\n"); /* This can only be a sym */ if (state->qc_update) - fprintf(fpx, "sym %s -> %s %"PRIu64"u\n", e->name, e->sym_target, (uint64_t)st.st_mtime); + fprintf(fpx, "sym %s -> %s %"PRIu64"\n", e->name, e->sym_target, (uint64_t)st.st_mtime); } else { --num_files; ++num_files_ignored; |