replace copy_spaces and copy_chars functions with equivalent memset.

`memset(ptr, ' ', (size_t) bd.endspaces);`?