Make sure first argument is an int when using %.*s to print e.g. chunks

This commit is contained in:
Tobias Brunner
2012-09-28 18:01:49 +02:00
parent 4bc24ba794
commit a05f3b2021
17 changed files with 52 additions and 46 deletions
@@ -475,7 +475,8 @@ static bool login(ENGINE *engine, chunk_t keyid)
{
found = TRUE;
key = shared->get_key(shared);
if (snprintf(pin, sizeof(pin), "%.*s", key.len, key.ptr) >= sizeof(pin))
if (snprintf(pin, sizeof(pin),
"%.*s", (int)key.len, key.ptr) >= sizeof(pin))
{
continue;
}
+1 -1
View File
@@ -285,7 +285,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
else
{
DBG1(DBG_ASN, " encryption algorithm '%.*s'"
" not supported", dek.len, dek.ptr);
" not supported", (int)dek.len, dek.ptr);
return NOT_SUPPORTED;
}
eat_whitespace(&value);
@@ -109,7 +109,8 @@ static void find_certificates(private_pkcs11_creds_t *this,
if (cert)
{
DBG1(DBG_CFG, " loaded %strusted cert '%.*s'",
entry->trusted ? "" : "un", entry->label.len, entry->label.ptr);
entry->trusted ? "" : "un", (int)entry->label.len,
entry->label.ptr);
/* trusted certificates are also returned as untrusted */
this->untrusted->insert_last(this->untrusted, cert);
if (entry->trusted)
@@ -120,7 +121,7 @@ static void find_certificates(private_pkcs11_creds_t *this,
else
{
DBG1(DBG_CFG, " loading cert '%.*s' failed",
entry->label.len, entry->label.ptr);
(int)entry->label.len, entry->label.ptr);
}
free(entry->value.ptr);
free(entry->label.ptr);
+1 -1
View File
@@ -334,7 +334,7 @@ static bool parse_challengePassword(private_x509_pkcs10_t *this, chunk_t blob, i
return FALSE;
}
DBG2(DBG_ASN, "L%d - challengePassword:", level);
DBG4(DBG_ASN, " '%.*s'", blob.len, blob.ptr);
DBG4(DBG_ASN, " '%.*s'", (int)blob.len, blob.ptr);
return TRUE;
}