MCPcopy Create free account
hub / github.com/catboost/catboost / TryPrintf

Function TryPrintf

util/stream/printf.cpp:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18static inline size_t TryPrintf(void* ptr, size_t len, IOutputStream& out, const char* fmt, va_list params) {
19 va_list lst;
20 va_copy(lst, params);
21 const int ret = vsnprintf((char*)ptr, len, fmt, lst);
22 va_end(lst);
23
24 if (ret < 0) {
25 return len;
26 }
27
28 if ((size_t)ret < len) {
29 out.Write(ptr, (size_t)ret);
30 }
31
32 return (size_t)ret;
33}
34
35size_t Printf(IOutputStream& out, const char* fmt, va_list params) {
36 size_t guess = 0;

Callers 1

PrintfFunction · 0.85

Calls 2

vsnprintfFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected