]> git.tuebingen.mpg.de Git - tfortune.git/commit - tfortune.c
com_stats(): Avoid division by zero.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 17 Jun 2019 11:27:36 +0000 (13:27 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 18 Jun 2019 11:37:55 +0000 (13:37 +0200)
commit278b70e25a37bae191066c4e08f96fd8624f31e4
tree03c409c85cb7e2820ad89804cd7ba002592ff345
parent18c4c002c310e9ffa47bad14c967d9e4c02d8d2a
com_stats(): Avoid division by zero.

If no epigrams are defined yet, the arguments to printf() contain
a division by zero which results in output like:

average number of epigrams per file     -nan
average number of tags per epigram.     -nan
average number of tag recurrence...     -nan

This is not a wrong per se, but it seems to be safer to special case
this and print zero.
tfortune.c