Skip to content

Commit 8081cf6

Browse files
authored
Merge pull request #1881 from hjelmn/pmix_bug_fix
pmix/pmix2x: add missing increment in loop
2 parents 31b7be6 + 03bce91 commit 8081cf6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

opal/mca/pmix/pmix2x/pmix2x_client.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
77
* All rights reserved.
88
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
9+
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
10+
* reserved.
911
* $COPYRIGHT$
1012
*
1113
* Additional copyrights may follow
@@ -435,7 +437,7 @@ int pmix2x_get(const opal_process_name_t *proc, const char *key,
435437
n=0;
436438
OPAL_LIST_FOREACH(ival, info, opal_value_t) {
437439
(void)strncpy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN);
438-
pmix2x_value_load(&pinfo[n].value, ival);
440+
pmix2x_value_load(&pinfo[n++].value, ival);
439441
}
440442
} else {
441443
pinfo = NULL;
@@ -645,7 +647,7 @@ int pmix2x_lookup(opal_list_t *data, opal_list_t *info)
645647
PMIX_INFO_CREATE(pinfo, ninfo);
646648
n=0;
647649
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
648-
(void)strncpy(pinfo[n++].key, iptr->key, PMIX_MAX_KEYLEN);
650+
(void)strncpy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN);
649651
pmix2x_value_load(&pinfo[n].value, iptr);
650652
++n;
651653
}
@@ -823,7 +825,7 @@ int pmix2x_unpublish(char **keys, opal_list_t *info)
823825
PMIX_INFO_CREATE(pinfo, ninfo);
824826
n=0;
825827
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
826-
(void)strncpy(pinfo[n++].key, iptr->key, PMIX_MAX_KEYLEN);
828+
(void)strncpy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN);
827829
pmix2x_value_load(&pinfo[n].value, iptr);
828830
++n;
829831
}

0 commit comments

Comments
 (0)