fixed some bugs, and made little progress in buffer.cpp
Merge pull request #4 from jackyujieyang/master

fixed some bugs, and made little progress in buffer.cpp