From a3c79fcdffd69349aa5d4674167501805bc6a092 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Thu, 30 Jan 2020 19:24:56 -0600 Subject: [PATCH] FileManager: Fix building with clang FileUtils.cpp:131:34: error: cannot pass object of non-trivial type 'const AK::String' through variadic method; call will abort at runtime [-Wnon-pod-varargs] --- Applications/FileManager/FileUtils.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Applications/FileManager/FileUtils.cpp b/Applications/FileManager/FileUtils.cpp index cf7294717e..c9ab8d2cc9 100644 --- a/Applications/FileManager/FileUtils.cpp +++ b/Applications/FileManager/FileUtils.cpp @@ -127,10 +127,8 @@ bool copy_file(const String& src_path, const String& dst_path, const struct stat if (errno != EISDIR) { return false; } - StringBuilder builder; - builder.appendf("%s/%s", dst_path, FileSystemPath(src_path).basename()); - String dst_path = builder.to_string(); - dst_fd = creat(dst_path.characters(), 0666); + auto dst_dir_path = String::format("%s/%s", dst_path.characters(), FileSystemPath(src_path).basename().characters()); + dst_fd = creat(dst_dir_path.characters(), 0666); if (dst_fd < 0) { return false; }