Skip to content

Commit

Permalink
dpctl: Fix shadowed iterator in show_dpif().
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Pettit <[email protected]>
Acked-by: Daniele Di Proietto <[email protected]>
  • Loading branch information
justinpettit committed Jul 13, 2016
1 parent f95523c commit 270fa6d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/dpctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,13 +577,10 @@ show_dpif(struct dpif *dpif, struct dpctl_params *dpctl_p)
smap_init(&config);
error = netdev_get_config(netdev, &config);
if (!error) {
const struct smap_node **nodes;
size_t i;

nodes = smap_sort(&config);
for (i = 0; i < smap_count(&config); i++) {
const struct smap_node *node = nodes[i];
dpctl_print(dpctl_p, "%c %s=%s", i ? ',' : ':',
const struct smap_node **nodes = smap_sort(&config);
for (size_t j = 0; j < smap_count(&config); j++) {
const struct smap_node *node = nodes[j];
dpctl_print(dpctl_p, "%c %s=%s", j ? ',' : ':',
node->key, node->value);
}
free(nodes);
Expand Down

0 comments on commit 270fa6d

Please sign in to comment.