dr_snprintf

Function dr_snprintf 

Source
pub unsafe extern "C" fn dr_snprintf(
    buf: *mut c_char,
    max: usize,
    fmt: *const c_char,
    ...
) -> c_int
Expand description

Utility routine to print a formatted message to a string. Will not print more than max characters. If successful, returns the number of characters printed, not including the terminating null character. If the number of characters to write equals max, then the caller is responsible for supplying a terminating null character. If the number of characters to write exceeds max, then max characters are written and -1 is returned. If an error occurs, a negative value is returned. \note This routine supports printing wide characters via the ls or S format specifiers. On Windows, they are assumed to be UTF-16, and are converted to UTF-8. On Linux, they are converted by simply dropping the high-order bytes. \note When printing floating-point values, the caller’s code should use proc_save_fpstate() or be inside a clean call that has requested to preserve the floating-point state, unless it can prove that its compiler will not use x87 operations..