From ea8864badfbd4c3efbd56ae8f987e4ae7513002a Mon Sep 17 00:00:00 2001 From: Colin Misare Date: Mon, 24 Nov 2014 16:35:55 -0700 Subject: [PATCH] printing unsigned fields as unsigned --- lib/luks1/keymanage.c | 2 +- lib/setup.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/luks1/keymanage.c b/lib/luks1/keymanage.c index f2e5b5de..2c8b5f36 100644 --- a/lib/luks1/keymanage.c +++ b/lib/luks1/keymanage.c @@ -804,7 +804,7 @@ int LUKS_set_key(unsigned int keyIndex, hdr->keyblock[keyIndex].passwordIterations = at_least((uint32_t)PBKDF2_temp, LUKS_SLOT_ITERATIONS_MIN); - log_dbg("Key slot %d use %d password iterations.", keyIndex, hdr->keyblock[keyIndex].passwordIterations); + log_dbg("Key slot %d use %" PRIu32 " password iterations.", keyIndex, hdr->keyblock[keyIndex].passwordIterations); derived_key = crypt_alloc_volume_key(hdr->keyBytes, NULL); if (!derived_key) diff --git a/lib/setup.c b/lib/setup.c index e1be9818..e2551cf5 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -2430,12 +2430,12 @@ static int _luks_dump(struct crypt_device *cd) int i; log_std(cd, "LUKS header information for %s\n\n", mdata_device_path(cd)); - log_std(cd, "Version: \t%d\n", cd->u.luks1.hdr.version); + log_std(cd, "Version: \t%" PRIu16 "\n", cd->u.luks1.hdr.version); log_std(cd, "Cipher name: \t%s\n", cd->u.luks1.hdr.cipherName); log_std(cd, "Cipher mode: \t%s\n", cd->u.luks1.hdr.cipherMode); log_std(cd, "Hash spec: \t%s\n", cd->u.luks1.hdr.hashSpec); - log_std(cd, "Payload offset:\t%d\n", cd->u.luks1.hdr.payloadOffset); - log_std(cd, "MK bits: \t%d\n", cd->u.luks1.hdr.keyBytes * 8); + log_std(cd, "Payload offset:\t%" PRIu32 "\n", cd->u.luks1.hdr.payloadOffset); + log_std(cd, "MK bits: \t%" PRIu32 "\n", cd->u.luks1.hdr.keyBytes * 8); log_std(cd, "MK digest: \t"); hexprint(cd, cd->u.luks1.hdr.mkDigest, LUKS_DIGESTSIZE, " "); log_std(cd, "\n"); @@ -2444,12 +2444,12 @@ static int _luks_dump(struct crypt_device *cd) log_std(cd, "\n \t"); hexprint(cd, cd->u.luks1.hdr.mkDigestSalt+LUKS_SALTSIZE/2, LUKS_SALTSIZE/2, " "); log_std(cd, "\n"); - log_std(cd, "MK iterations: \t%d\n", cd->u.luks1.hdr.mkDigestIterations); + log_std(cd, "MK iterations: \t%" PRIu32 "\n", cd->u.luks1.hdr.mkDigestIterations); log_std(cd, "UUID: \t%s\n\n", cd->u.luks1.hdr.uuid); for(i = 0; i < LUKS_NUMKEYS; i++) { if(cd->u.luks1.hdr.keyblock[i].active == LUKS_KEY_ENABLED) { log_std(cd, "Key Slot %d: ENABLED\n",i); - log_std(cd, "\tIterations: \t%d\n", + log_std(cd, "\tIterations: \t%" PRIu32 "\n", cd->u.luks1.hdr.keyblock[i].passwordIterations); log_std(cd, "\tSalt: \t"); hexprint(cd, cd->u.luks1.hdr.keyblock[i].passwordSalt, @@ -2459,9 +2459,9 @@ static int _luks_dump(struct crypt_device *cd) LUKS_SALTSIZE/2, LUKS_SALTSIZE/2, " "); log_std(cd, "\n"); - log_std(cd, "\tKey material offset:\t%d\n", + log_std(cd, "\tKey material offset:\t%" PRIu32 "\n", cd->u.luks1.hdr.keyblock[i].keyMaterialOffset); - log_std(cd, "\tAF stripes: \t%d\n", + log_std(cd, "\tAF stripes: \t%" PRIu32 "\n", cd->u.luks1.hdr.keyblock[i].stripes); } else