tested against buffers without null termination