Instantiate $buf before loop to eliminate undefined variable warning
Merge pull request #8 from triq6/master

Instantiate $buf before loop to eliminate undefined variable warning