Add a few more VxWorks targets.
[openssl.git] / crypto / conf / conf_mod.c
index 7e88cfb62506c986e11d1bf75cb79089215bed63..edcc08921c2fe2711ecacc990b4a4460630491cf 100644 (file)
@@ -130,9 +130,11 @@ int CONF_modules_load(const CONF *cnf, const char *appname,
 
        int ret, i;
 
-       if (!cnf || !appname)
+       if (!cnf)
                return 1;
 
+       if (appname == NULL)
+               appname = "openssl_conf";
 
        vsection = NCONF_get_string(cnf, NULL, appname); 
 
@@ -163,7 +165,7 @@ int CONF_modules_load(const CONF *cnf, const char *appname,
 int CONF_modules_load_file(const char *filename, const char *appname,
                           unsigned long flags)
        {
-       char *file;
+       char *file = NULL;
        CONF *conf = NULL;
        int ret = 0;
        conf = NCONF_new(NULL);
@@ -178,8 +180,6 @@ int CONF_modules_load_file(const char *filename, const char *appname,
                }
        else
                file = (char *)filename;
-       if (appname == NULL)
-               appname = "openssl_conf";
 
        if (NCONF_load(conf, file, NULL) <= 0)
                {
@@ -230,7 +230,7 @@ static int module_run(const CONF *cnf, char *name, char *value,
                {
                if (!(flags & CONF_MFLAGS_SILENT))
                        {
-                       char rcode[10];
+                       char rcode[DECIMAL_SIZE(ret)+1];
                        CONFerr(CONF_F_CONF_MODULES_LOAD, CONF_R_MODULE_INITIALIZATION_ERROR);
                        sprintf(rcode, "%-8d", ret);
                        ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);
@@ -422,6 +422,7 @@ void CONF_modules_unload(int all)
        {
        int i;
        CONF_MODULE *md;
+       CONF_modules_finish();
        /* unload modules in reverse order */
        for (i = sk_CONF_MODULE_num(supported_modules) - 1; i >= 0; i--)
                {