General note for future. For functions with -1 return values as error, we have used "< 0" in few places, and "!= 0" in few other places (and one "== -1" for ftello). I think it is better to use the same style in all places.