Fix buf[ret] = 0 missing after read