Convert sprintf() to snprintf().

Consider to use
in utilities.h.