Correctly append to a fixed buffer while logging

I no longer like snprintf().  I didn't realize it returns the size that *would have been written*, instead of the size that *was actually written* (as gcc used to do before c99.)  That's terrible.

Will take care of #7050 once merged and native updated.

-[Unknown]