Fixed return values of several functions (e.g. return FALSE for pointer types).
authorTobias Brunner <tobias@strongswan.org>
Mon, 7 May 2012 13:47:00 +0000 (15:47 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 31 May 2012 15:39:04 +0000 (17:39 +0200)
scripts/crypt_burn.c
src/libimcv/imc/imc_agent.c
src/libstrongswan/plugins/agent/agent_private_key.c
src/libstrongswan/plugins/pgp/pgp_builder.c
src/libstrongswan/plugins/pgp/pgp_cert.c
src/libstrongswan/plugins/plugin_loader.c
src/libstrongswan/plugins/x509/x509_cert.c
src/libstrongswan/printf_hook.c

index 25f18d4..5c41b19 100644 (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)
                        {
index 6bba697..de2f959 100644 (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
index dae130b..60b57ad 100644 (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,
index 440e70a..3611577 100644 (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))
        {
index 5b2ec63..70a2368 100644 (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:
index de5ce24..aabeb1f 100644 (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)
                {
index 59f4900..25d92d5 100644 (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);
index 7e7045d..c3b5191 100644 (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;
 }
 
 /**