Make buf a temp array, remove spurious printout