use full buffer length, not strlen