@@ -304,7 +304,7 @@ mca_coll_tuned_module_construct(mca_coll_tuned_module_t *module)
304
304
305
305
int coll_tuned_alg_from_str (int collective_id , const char * alg_name , int * alg_value ) {
306
306
int rc ;
307
- if (collective_id > COLLCOUNT || collective_id < 0 ) { return OPAL_ERROR ; };
307
+ if (collective_id >= COLLCOUNT || collective_id < 0 ) { return OPAL_ERROR ; };
308
308
rc = coll_tuned_algorithm_enums [collective_id ]-> value_from_string (
309
309
coll_tuned_algorithm_enums [collective_id ],
310
310
alg_name , alg_value );
@@ -314,7 +314,7 @@ int coll_tuned_alg_from_str(int collective_id, const char *alg_name, int *alg_va
314
314
/* return the enum's value and string. caller's responsibility to free alg_string if NULL was not provided. */
315
315
int coll_tuned_alg_to_str (int collective_id , int alg_value , char * * alg_string ) {
316
316
int rc ;
317
- if (collective_id > COLLCOUNT || collective_id < 0 ) { return OPAL_ERROR ; };
317
+ if (collective_id >= COLLCOUNT || collective_id < 0 ) { return OPAL_ERROR ; };
318
318
rc = coll_tuned_algorithm_enums [collective_id ]-> string_from_value (
319
319
coll_tuned_algorithm_enums [collective_id ],
320
320
alg_value , alg_string );
@@ -326,7 +326,7 @@ int coll_tuned_alg_register_options(int collective_id, mca_base_var_enum_t *opti
326
326
/* use the same enum used for mca parameters to allow tuning files to use
327
327
algorithm names rather than just numbers.*/
328
328
if (!options ) { return OPAL_ERROR ; }
329
- if (collective_id > COLLCOUNT || collective_id < 0 ) {
329
+ if (collective_id >= COLLCOUNT || collective_id < 0 ) {
330
330
return OPAL_ERROR ;
331
331
}
332
332
0 commit comments