int64_t x = 123;
sprintf(buffer, "%" PRIi64, x);
produces the following warning
Check to be sure that the non-constant format string passed as argument 2 to this function call does not come from an untrusted source that could have added formatting characters that the code is not prepared to handle.
PRIi64 is defined in standard header <inttypes.h> as a constant string.