handle 0 buf