MCPcopy Create free account
hub / github.com/HyperDbg/HyperDbg / PlatformSprintf

Function PlatformSprintf

hyperdbg/include/platform/kernel/code/PlatformMem.c:28–43  ·  view source on GitHub ↗

* @brief Platform independent wrapper for sprintf_s / snprintf * * @param Buffer output buffer * @param BufferSize size of the output buffer * @param Format format string * @return INT number of characters written, or -1 on error */

Source from the content-addressed store, hash-verified

26 * @return INT number of characters written, or -1 on error
27 */
28INT
29PlatformSprintf(char * Buffer, SIZE_T BufferSize, const char * Format, ...)
30{
31 va_list Args;
32 va_start(Args, Format);
33 INT Result;
34#if defined(_WIN32) || defined(_WIN64)
35 Result = vsprintf_s(Buffer, BufferSize, Format, Args);
36#elif defined(__linux__)
37 Result = vsnprintf(Buffer, BufferSize, Format, Args);
38#else
39# error "Unsupported platform"
40#endif
41 va_end(Args);
42 return Result;
43}
44
45/////////////////////////////////////////////////
46/// ... New Unified API ...

Callers 1

ApplyFormatSpecifierFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected