Hi,
Instead of using 'sprintf' it is better to use 'snprintf'. You specify how big the 'string' is so there isn't any chance of a buffer overrun crashing your program. :-)
If you are worried abount code size you could use the version in the newlib library.
Regards Neil.