cpp-gamedev/forest

Problems with <clear> style

flyingsl0ths opened this issue · 0 comments

Garbage values

When placed after calls to

std::cout << forest::literal<N>("<style>...</style>") << '\n'

and M is the exact length of the string passed to forest::literal

std::cout << forest::literal<M>("<clear>...</clear>") << '\n'

The outputted text between <clear></clear> contains trailing garbage values
and on occasion bits of the cleared output

Program crashes

When placed after a call to forest::print

and M is the exact length of the string passed to forest::literal

std::cout << forest::literal<M>("<clear>...</clear>") << '\n'

The call causes the program to terminate with the following message
displayed on the terminal

Text between clear..���U
free(): invalid pointer
Aborted (core dumped)  example/forest-example