fix null pointer subtraction and comparison in stdio