Resolve shortening errors
Resolve shortening errors

The function takes short but we were doing calculations in the integer
type so that shortening of the result was occuring. This resolves that.

GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver