Skip to content

Commit

Permalink
Specialize formatted_log for string without arguments (fix potential …
Browse files Browse the repository at this point in the history
…security error).
  • Loading branch information
harrism committed Nov 13, 2024
1 parent 58e8a55 commit 89fceea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/rmm/detail/format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ std::string formatted_log(std::string const& format, Args&&... args)
return {buf.get(), buf.get() + size - 1}; // drop '\0'
}

// specialization for no arguments
template <>
inline std::string formatted_log(std::string const& format)
{
return format;
}

// Stringify a size in bytes to a human-readable value
inline std::string format_bytes(std::size_t value)
{
Expand Down

0 comments on commit 89fceea

Please sign in to comment.