mirror of
https://github.com/acpica/acpica/
synced 2025-02-05 16:14:06 +03:00
AcpiSrc: Prevent two possible div-by-zero conditions.
Ensure statistics display does not divide-by-zero.
This commit is contained in:
parent
5ee27590d9
commit
b71852ab29
@ -317,10 +317,18 @@ AsDisplayStats (
|
||||
printf ("%8u Lines of non-comment whitespace\n", Gbl_WhiteLines);
|
||||
printf ("%8u Lines of comments\n", Gbl_CommentLines);
|
||||
printf ("%8u Long lines found\n", Gbl_LongLines);
|
||||
|
||||
if (Gbl_WhiteLines > 0)
|
||||
{
|
||||
printf ("%8.1f Ratio of code to whitespace\n",
|
||||
((float) Gbl_SourceLines / (float) Gbl_WhiteLines));
|
||||
}
|
||||
|
||||
if ((Gbl_CommentLines + Gbl_NonAnsiComments) > 0)
|
||||
{
|
||||
printf ("%8.1f Ratio of code to comments\n",
|
||||
((float) Gbl_SourceLines / (float) (Gbl_CommentLines + Gbl_NonAnsiComments)));
|
||||
}
|
||||
|
||||
if (!Gbl_TotalLines)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user