printf("received blocks / received groups: %u / %u\n",
statistics->block_cnt, statistics->group_cnt);
- float block_error_percentage =
- ((float)statistics->block_error_cnt / statistics->block_cnt) * 100.0;
+ float block_error_percentage = 0;
+
+ if (statistics->block_cnt)
+ block_error_percentage =
+ ((float)statistics->block_error_cnt / statistics->block_cnt) * 100.0;
printf("block errors / group errors: %u (%3.2f%%) / %u \n",
statistics->block_error_cnt,
block_error_percentage, statistics->group_error_cnt);
- float block_corrected_percentage =
- ((float)statistics->block_corrected_cnt / statistics->block_cnt) * 100.0;
+
+ float block_corrected_percentage = 0;
+
+ if (statistics->block_cnt)
+ block_corrected_percentage = (
+ (float)statistics->block_corrected_cnt / statistics->block_cnt) * 100.0;
printf("corrected blocks: %u (%3.2f%%)\n",
statistics->block_corrected_cnt, block_corrected_percentage);
- for(int i=0; i<16; i++)
+ for (int i = 0; i < 16; i++)
printf("Group %02d: %u\n", i, statistics->group_type_cnt[i]);
}