Yes, this is certainly enough for debugging purposes. Actually, it all started with something along these lines. However, I began to feel the need for a more general-purpose function, something I can use to feed a display, to log to EEPROM and whatnot. Also, the sprintf() approach lets me do some padding, so different values with different numbers of digits will line up on the decimal point end be easier to read.
There were some interesting points in all the answers I got, but one thing is still unclear to me. Can I get away with using my code the way it is, or should I rather forget about malloc() and its dangers and do it some safer way, no matter what?