fix buffer bug & astyle