summaryrefslogtreecommitdiff
path: root/Applications/FileManager/FileUtils.cpp
diff options
context:
space:
mode:
authorjoshua stein <jcs@jcs.org>2020-01-30 19:24:56 -0600
committerAndreas Kling <kling@serenityos.org>2020-02-05 18:39:45 +0100
commita3c79fcdffd69349aa5d4674167501805bc6a092 (patch)
tree9e0eb3cd13d94a872b0978c042086417fea978a0 /Applications/FileManager/FileUtils.cpp
parent7d06e37a63627efad0d472afb9bd17ff95ab5a57 (diff)
downloadserenity-a3c79fcdffd69349aa5d4674167501805bc6a092.zip
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]
Diffstat (limited to 'Applications/FileManager/FileUtils.cpp')
-rw-r--r--Applications/FileManager/FileUtils.cpp6
1 files 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;
}