Whoops, used "buffer" when I meant "buf".