mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 04:05:31 -04:00
universal7885: liblogfmt: IDKIDC -Wformat-security
This commit is contained in:
parent
5c7c906519
commit
60659bf10c
1 changed files with 3 additions and 0 deletions
|
|
@ -5,9 +5,12 @@
|
|||
|
||||
template <typename... Args>
|
||||
std::string _make_str(const std::string& filename, int line, const std::string& fmt, Args... args) {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wformat-security"
|
||||
const int size = std::snprintf(nullptr, 0, fmt.c_str(), args...);
|
||||
std::vector<char> buf(size + 1);
|
||||
std::snprintf(buf.data(), buf.size(), fmt.c_str(), args...);
|
||||
#pragma clang diagnostic pop
|
||||
std::stringstream ss;
|
||||
ss << "[" << filename << ":" << line << "] " << std::string(buf.begin(), buf.end());
|
||||
return ss.str();
|
||||
|
|
|
|||
Loading…
Reference in a new issue