diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-06-16 22:02:35 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-17 15:02:03 +0200 |
commit | 363b7351b835992564d3f9f0dc946f13b470b9e5 (patch) | |
tree | e6735bcbf6a28697b99ab10a79ce3403b6282cac /Applications/FileManager | |
parent | 0674d9362bf1ee08612ea73bff742ccbf80ea7c9 (diff) | |
download | serenity-363b7351b835992564d3f9f0dc946f13b470b9e5.zip |
FileManager: Use Core::File::read_link()
Diffstat (limited to 'Applications/FileManager')
-rw-r--r-- | Applications/FileManager/PropertiesDialog.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Applications/FileManager/PropertiesDialog.cpp b/Applications/FileManager/PropertiesDialog.cpp index 8caa182dd5..4c2992b412 100644 --- a/Applications/FileManager/PropertiesDialog.cpp +++ b/Applications/FileManager/PropertiesDialog.cpp @@ -117,12 +117,11 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo properties.append({ "Location:", path }); if (S_ISLNK(m_mode)) { - char link_destination[PATH_MAX]; - ssize_t len = readlink(path.characters(), link_destination, sizeof(link_destination)); - if (len < 0) { + auto link_destination = Core::File::read_link(path); + if (link_destination.is_null()) { perror("readlink"); } else { - properties.append({ "Link target:", String(link_destination, len) }); + properties.append({ "Link target:", link_destination }); } } |