Fixed return values of several functions (e.g. return FALSE for pointer types).

This commit is contained in:
Tobias Brunner 2012-05-07 15:47:00 +02:00
parent 060b508e0e
commit 79d5c4f06b
8 changed files with 10 additions and 10 deletions

View File

@ -65,7 +65,7 @@ int main(int argc, char *argv[])
chunk_create(iv, aead->get_iv_size(aead)), NULL))
{
fprintf(stderr, "aead integrity check failed!\n");
return FALSE;
return 1;
}
if (limit && ++i == limit)
{

View File

@ -313,7 +313,7 @@ static bool get_bool_attribute(private_imc_agent_t *this, TNC_ConnectionID id,
return this->get_attribute &&
this->get_attribute(this->id, id, attribute_id, 4, buf, &len) ==
TNC_RESULT_SUCCESS && len == 1 && *buf == 0x01;
}
}
/**
* Read a string attribute

View File

@ -398,7 +398,7 @@ agent_private_key_t *agent_private_key_open(key_type_t type, va_list args)
}
if (!path)
{
return FALSE;
return NULL;
}
INIT(this,

View File

@ -152,7 +152,7 @@ static private_key_t *parse_private_key(chunk_t blob)
}
if (!pgp_read_scalar(&packet, 1, &version))
{
return FALSE;
return NULL;
}
switch (version)
{
@ -166,7 +166,7 @@ static private_key_t *parse_private_key(chunk_t blob)
break;
default:
DBG1(DBG_LIB, "PGP packet version V%d not supported", version);
return FALSE;
return NULL;
}
if (!pgp_read_scalar(&packet, 4, &created))
{

View File

@ -441,14 +441,14 @@ pgp_cert_t *pgp_cert_load(certificate_type_t type, va_list args)
if (!parse_signature(this, packet))
{
destroy(this);
return FALSE;
return NULL;
}
break;
case PGP_PKT_USER_ID:
if (!parse_user_id(this, packet))
{
destroy(this);
return FALSE;
return NULL;
}
break;
default:

View File

@ -531,7 +531,7 @@ METHOD(plugin_loader_t, load_plugins, bool,
if (snprintf(file, sizeof(file), "%s/libstrongswan-%s.so",
path, token) >= sizeof(file))
{
return NULL;
return FALSE;
}
if (!load_plugin(this, token, file) && critical)
{

View File

@ -1492,7 +1492,7 @@ end:
if (hasher == NULL)
{
DBG1(DBG_ASN, " unable to create hash of certificate, SHA1 not supported");
return NULL;
return FALSE;
}
hasher->allocate_hash(hasher, this->encoding, &this->encoding_hash);
hasher->destroy(hasher);

View File

@ -173,7 +173,7 @@ static int custom_fmt_cb(Vstr_base *base, size_t pos, Vstr_fmt_spec *fmt_spec)
{
vstr_add_buf(base, pos, buf, written);
}
return TRUE;
return 1;
}
/**