about summary refs log tree commit diff
path: root/src/libutil/archive.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/archive.cc')
-rw-r--r--src/libutil/archive.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index f605e8b61954..90a039164b58 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -122,11 +122,8 @@ static void dump(const Path & path, DumpSink & sink)
     else if (S_ISLNK(st.st_mode)) {
         writeString("type", sink);
         writeString("symlink", sink);
-        char buf[st.st_size];
-        if (readlink(path.c_str(), buf, st.st_size) != st.st_size)
-            throw SysError("reading symbolic link " + path);
         writeString("target", sink);
-        writeString(string(buf, st.st_size), sink);
+        writeString(readLink(path), sink);
     }
 
     else throw Error("unknown file type: " + path);