The function sprintf is marked deprecated with the latest Clang version. Move from sprintf to snprintf.