Update buffer.c

bugfix...