Skip to content

Commit

Permalink
don't crash when -1 replica
Browse files Browse the repository at this point in the history
Change-Id: I3237945fdaa0e8cac682450402fbc15220262ba0
Reviewed-on: http://review.northscale.com/2958
Reviewed-by: Sean Lynch <seanl@literati.org>
Tested-by: Sean Lynch <seanl@literati.org>
  • Loading branch information
steveyen authored and Sean Lynch committed Oct 1, 2010
1 parent 1d8154d commit 56ce7ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vbuckettool.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ int main(int argc, char **argv) {
printf(" replicas:");
for (int j = 0; j < num_replicas; j++) {
int r = vbucket_get_replica(vb, v, j);
if (r == -1) {
break;
}

const char *replica = vbucket_config_get_server(vb, r);
if (replica != NULL) {
printf(" %s", replica);
Expand Down

0 comments on commit 56ce7ed

Please sign in to comment.