]> diplodocus.org Git - nmh/commit
%(divide): Avoid SIGFPE on integer divide of INT_MIN by -1.
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 24 Jan 2018 00:27:01 +0000 (00:27 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Thu, 25 Jan 2018 14:44:44 +0000 (14:44 +0000)
commit5bc2777230cdc4cea23ff87df356af3fb0cfadf9
tree2d38b8d34b416d3cb89bc03c1494a8e4653fcbc2
parentec7b66a6b21b391cf4ceaa0e38812c923f06cd94
%(divide): Avoid SIGFPE on integer divide of INT_MIN by -1.

Dividing by zero isn't the only cause of SIGFPE.
    fmttest -raw -format '%(num -2147483648) %(divide -1)' foo
Also, add FIXME comment suggesting the user should be told of overflow
rather than silently using zero as the result.
sbr/fmt_scan.c