getint that properly handles + or - signs
The method modifies the parameter while it is processing input. It should store the processing result locally and then assign it once it is finished.
It is unclear what the return value of the method means just by reading the code. If it is supposed to indicate success (return is not 0) or failure (return value is 0) then I think you have subtle bug in there in the case when the last character read from input is '\0' - in which case you return 0 even though you potentially have parsed a number. You should simply return 1; to indicate the success case.