fix missing errno.h include

add some more overflow treatment and make sure to set errno properly

(0) -1000 -300 -100 -30 -10 -2 +2 +10 tip

mercurial