fix multiple stdio functions' behavior on zero-length operations