Revert "sprintf -> snprintf and strcat -> strlcat"

This reverts commit 9277bd9b619f09d890845a1b6167ae34752a9e32.
Revert "cleanup"

This reverts commit 33c3361035d0f9ccba2bbb82e484597903d17025.