Fix indexing error when getting nodes

This commit is contained in:
Armon Dadgar 2013-12-31 18:16:09 -08:00
parent 4b2be68cc9
commit 61bad89e51
1 changed files with 2 additions and 2 deletions

View File

@ -76,8 +76,8 @@ func (c *Catalog) ListNodes(dc string, reply *structs.Nodes) error {
// Format the response // Format the response
nodes := structs.Nodes(make([]structs.Node, len(rawNodes)/2)) nodes := structs.Nodes(make([]structs.Node, len(rawNodes)/2))
for i := 0; i < len(rawNodes); i += 2 { for i := 0; i < len(nodes); i++ {
nodes[i] = structs.Node{rawNodes[i], rawNodes[i+1]} nodes[i] = structs.Node{rawNodes[i*2], rawNodes[i*2+1]}
} }
*reply = nodes *reply = nodes