Coverity fix: sprintf is replaced by snprintf