Switch to strncat instead of sprintf.