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
+4 -4
View File
@@ -396,7 +396,7 @@ METHOD(imv_agent_t, create_state, TNC_Result,
has_long = get_bool_attribute(this, conn_id, TNC_ATTRIBUTEID_HAS_LONG_TYPES);
has_excl = get_bool_attribute(this, conn_id, TNC_ATTRIBUTEID_HAS_EXCLUSIVE);
has_soh = get_bool_attribute(this, conn_id, TNC_ATTRIBUTEID_HAS_SOH);
tnccs_p = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFTNCCS_PROTOCOL);
tnccs_p = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFTNCCS_PROTOCOL);
tnccs_v = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFTNCCS_VERSION);
t_p = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFT_PROTOCOL);
t_v = get_str_attribute(this, conn_id, TNC_ATTRIBUTEID_IFT_VERSION);
@@ -478,7 +478,7 @@ METHOD(imv_agent_t, change_state, TNC_Result,
DBG1(DBG_IMV, "IMV %u \"%s\" was notified of unknown state %u "
"for Connection ID %u",
this->id, this->name, new_state, connection_id);
return TNC_RESULT_INVALID_PARAMETER;
return TNC_RESULT_INVALID_PARAMETER;
}
return TNC_RESULT_SUCCESS;
}
@@ -716,8 +716,8 @@ METHOD(imv_agent_t, provide_recommendation, TNC_Result,
lang_len <= BUF_LEN)
{
pref_lang.len = lang_len;
DBG2(DBG_IMV, "preferred language is '%.*s'",
pref_lang.len, pref_lang.ptr);
DBG2(DBG_IMV, "preferred language is '%.*s'", (int)pref_lang.len,
pref_lang.ptr);
}
/* find a reason string for the preferred or default language and set it */
@@ -38,7 +38,7 @@ static const char imc_name[] = "Scanner";
#define IMC_SUBTYPE PA_SUBTYPE_ITA_SCANNER
static imc_agent_t *imc_scanner;
/**
* see section 3.8.1 of TCG TNC IF-IMC Specification 1.3
*/
@@ -133,7 +133,7 @@ static bool do_netstat(ietf_attr_port_filter_t *attr)
enumerator_t *enumerator;
bool allowed, found = FALSE;
DBG2(DBG_IMC, "%.*s", strlen(buf)-1, buf);
DBG2(DBG_IMC, "%.*s", (int)(strlen(buf)-1), buf);
if (n++ < 2)
{
@@ -209,7 +209,7 @@ static bool do_netstat(ietf_attr_port_filter_t *attr)
}
}
enumerator->destroy(enumerator);
/* Skip the duplicate port entry */
if (found)
{
@@ -297,7 +297,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
return TNC_RESULT_FATAL;
}
/* parse received PA-TNC message and automatically handle any errors */
/* parse received PA-TNC message and automatically handle any errors */
result = imc_scanner->receive_message(imc_scanner, state, msg, msg_vid,
msg_subtype, src_imv_id, dst_imc_id, &pa_tnc_msg);