Fix to Coverity issue 72749, replaced sprintf with snprintf