@@ -304,7 +304,7 @@ mca_coll_tuned_module_construct(mca_coll_tuned_module_t *module)
304304
305305int coll_tuned_alg_from_str (int collective_id , const char * alg_name , int * alg_value ) {
306306 int rc ;
307- if (collective_id > COLLCOUNT || collective_id < 0 ) { return OPAL_ERROR ; };
307+ if (collective_id >= COLLCOUNT || collective_id < 0 ) { return OPAL_ERROR ; };
308308 rc = coll_tuned_algorithm_enums [collective_id ]-> value_from_string (
309309 coll_tuned_algorithm_enums [collective_id ],
310310 alg_name , alg_value );
@@ -314,7 +314,7 @@ int coll_tuned_alg_from_str(int collective_id, const char *alg_name, int *alg_va
314314/* return the enum's value and string. caller's responsibility to free alg_string if NULL was not provided. */
315315int coll_tuned_alg_to_str (int collective_id , int alg_value , char * * alg_string ) {
316316 int rc ;
317- if (collective_id > COLLCOUNT || collective_id < 0 ) { return OPAL_ERROR ; };
317+ if (collective_id >= COLLCOUNT || collective_id < 0 ) { return OPAL_ERROR ; };
318318 rc = coll_tuned_algorithm_enums [collective_id ]-> string_from_value (
319319 coll_tuned_algorithm_enums [collective_id ],
320320 alg_value , alg_string );
@@ -326,7 +326,7 @@ int coll_tuned_alg_register_options(int collective_id, mca_base_var_enum_t *opti
326326 /* use the same enum used for mca parameters to allow tuning files to use
327327 algorithm names rather than just numbers.*/
328328 if (!options ) { return OPAL_ERROR ; }
329- if (collective_id > COLLCOUNT || collective_id < 0 ) {
329+ if (collective_id >= COLLCOUNT || collective_id < 0 ) {
330330 return OPAL_ERROR ;
331331 }
332332
0 commit comments