cppcheck
fixed undefined behavior
nullptr
less string buffer moves
removed unused code