The charfuncs prototypes were returning 0 for success ("I wrote all the
characters you asked me to") or 1 for failure. When we get to verifying
signatures over data we may not know how much to read, so change them to
returning 0 on error/no more data and otherwise the count of the amount
of data read/written.