block: Avoid accessing past the end of the block_by_role array.
[pintos-anon] / src / devices / block.c
index 452c4331ff41aaa16534bb998d1b490349bc4217..a3acec16066240cc098f0c31d5a5c53efb99116a 100644 (file)
@@ -166,7 +166,7 @@ block_print_stats (void)
 {
   int i;
 
-  for (i = 0; i < BLOCK_CNT; i++)
+  for (i = 0; i < BLOCK_ROLE_CNT; i++)
     {
       struct block *block = block_by_role[i];
       if (block != NULL)