MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / format_float

Function format_float

extlibs/spdlog/src/fmt.cpp:17–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16 template <typename T>
17 int format_float(char* buf, std::size_t size, const char* format, int precision,
18 T value) {
19#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
20 if (precision > 100000)
21 throw std::runtime_error(
22 "fuzz mode - avoid large allocation inside snprintf");
23#endif
24 // Suppress the warning about nonliteral format string.
25 auto snprintf_ptr = FMT_SNPRINTF;
26 return precision < 0 ? snprintf_ptr(buf, size, format, value)
27 : snprintf_ptr(buf, size, format, precision, value);
28 }
29 struct sprintf_specs {
30 int precision;
31 char type;

Callers 1

sprintf_formatFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected