diff options
Diffstat (limited to 'source/tools/acpisrc/asmain.c')
-rw-r--r-- | source/tools/acpisrc/asmain.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/tools/acpisrc/asmain.c b/source/tools/acpisrc/asmain.c index baf4e2fc34c7a..b1f3402de9cd6 100644 --- a/source/tools/acpisrc/asmain.c +++ b/source/tools/acpisrc/asmain.c @@ -245,10 +245,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); - printf ("%8.1f Ratio of code to whitespace\n", - ((float) Gbl_SourceLines / (float) Gbl_WhiteLines)); - printf ("%8.1f Ratio of code to comments\n", - ((float) Gbl_SourceLines / (float) (Gbl_CommentLines + Gbl_NonAnsiComments))); + + 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) { |