Switch the order of the conditions in a while loop, so we check the range of "i" against the max, before using it to index into the array. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>