Skip to content

Commit

Permalink
Merge pull request #10325 from K900/ooformatting
Browse files Browse the repository at this point in the history
build-remote: fix format string shenanigans
  • Loading branch information
thufschmitt committed Mar 26, 2024
2 parents 1394d4e + 2d4edb9 commit 0bf0191
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/build-remote/build-remote.cc
Expand Up @@ -202,7 +202,7 @@ static int main_build_remote(int argc, char * * argv)
else
drvstr = "<unknown>";

auto error = HintFmt(errorText);
auto error = HintFmt::fromFormatString(errorText);
error
% drvstr
% neededSystem
Expand Down
4 changes: 4 additions & 0 deletions src/libutil/fmt.hh
Expand Up @@ -144,6 +144,10 @@ public:
: HintFmt("%s", Uncolored(literal))
{ }

static HintFmt fromFormatString(const std::string & format) {
return HintFmt(boost::format(format));
}

/**
* Interpolate the given arguments into the format string.
*/
Expand Down

0 comments on commit 0bf0191

Please sign in to comment.