Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

From: Sharon Melamed (sharonm_at_[hidden])
Date: 2007-04-18 07:55:40


Hi,

I want to add a patch to opal mca.

This patch replaces an 'atoi' call with a 'strtol' call.

If it's O.K with everyone I'll submit this patch by the end of the week.

 

Index: opal/mca/base/mca_base_param.c

===================================================================

--- opal/mca/base/mca_base_param.c (revision 14391)

+++ opal/mca/base/mca_base_param.c (working copy)

@@ -1673,7 +1673,7 @@

   if (NULL != param->mbp_env_var_name &&

       NULL != (env = getenv(param->mbp_env_var_name))) {

     if (MCA_BASE_PARAM_TYPE_INT == param->mbp_type) {

- storage->intval = atoi(env);

+ storage->intval = (int)strtol(env,(char**)NULL,0);

     } else if (MCA_BASE_PARAM_TYPE_STRING == param->mbp_type) {

       storage->stringval = strdup(env);

     }

@@ -1714,7 +1714,7 @@

         if (0 == strcmp(fv->mbpfv_param, param->mbp_full_name)) {

             if (MCA_BASE_PARAM_TYPE_INT == param->mbp_type) {

                 if (NULL != fv->mbpfv_value) {

- param->mbp_file_value.intval =
atoi(fv->mbpfv_value);

+ param->mbp_file_value.intval =
(int)strtol(fv->mbpfv_value,(char**)NULL,0);

                 } else {

                     param->mbp_file_value.intval = 0;

                 }

 

Thanks.

 

Sharon.