do not use %m in format strings

This is a glibc extension.
simplify bf_set_error()
clear the skip value when the buffer gets empty

See c1efda4 for more information.
avoid potential buffer overflow