summaryrefslogtreecommitdiff
path: root/SharedGraphics
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-08 20:01:49 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-08 20:01:49 +0200
commitc110cf193d32e49011df29f04c035054adefd10f (patch)
treeb1169e121792b5ba09756ef70661bcbdd3f183b7 /SharedGraphics
parentfc4022d1736e2cce3810698b9fe8a7832625277b (diff)
downloadserenity-c110cf193d32e49011df29f04c035054adefd10f.zip
Kernel: Have the open() syscall take an explicit path length parameter.
Instead of computing the path length inside the syscall handler, let the caller do that work. This allows us to implement to new variants of open() and creat(), called open_with_path_length() and creat_with_path_length(). These are suitable for use with e.g StringView.
Diffstat (limited to 'SharedGraphics')
-rw-r--r--SharedGraphics/Font.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/SharedGraphics/Font.cpp b/SharedGraphics/Font.cpp
index ec34aaab88..b46495ad3b 100644
--- a/SharedGraphics/Font.cpp
+++ b/SharedGraphics/Font.cpp
@@ -127,7 +127,7 @@ RefPtr<Font> Font::load_from_file(const StringView& path)
bool Font::write_to_file(const StringView& path)
{
- int fd = creat(String(path).characters(), 0644);
+ int fd = creat_with_path_length(path.characters_without_null_termination(), path.length(), 0644);
if (fd < 0) {
perror("open");
return false;