fixes in declaration of *buf