MCPcopy Create free account
hub / github.com/WheretIB/nullc / SafeSprintf

Function SafeSprintf

NULLC/translation/runtime.cpp:16–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#define __assert(_Expression) if(!(_Expression)){ printf("assertion failed"); abort(); };
15
16int SafeSprintf(char* dst, size_t size, const char* src, ...)
17{
18 va_list args;
19 va_start(args, src);
20
21 int result = vsnprintf(dst, size, src, args);
22 dst[size-1] = '\0';
23 return (result == -1 || (size_t)result >= size) ? (int)size : result;
24}
25
26template<typename T>
27class FastVector

Callers 2

OverrideFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected