Svace issue fix. use snprintf instead of memcpy