From 363b7351b835992564d3f9f0dc946f13b470b9e5 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 16 Jun 2020 22:02:35 +0300 Subject: [PATCH] FileManager: Use Core::File::read_link() --- Applications/FileManager/PropertiesDialog.cpp | 7 +++---- 1 file 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 }); } }