]> git.lyx.org Git - features.git/blobdiff - src/support/filetools.cpp
Fix unsafe use of fixed width arrays.
[features.git] / src / support / filetools.cpp
index 48ba7ef785ba00463e1df7126883a0fac3abf780..7f00ebfb8cb1fbae95a0ee1b6d55feb5f7463d95 100644 (file)
@@ -739,8 +739,7 @@ docstring const makeDisplayPath(string const & path, unsigned int threshold)
 bool readLink(FileName const & file, FileName & link)
 {
 #ifdef HAVE_READLINK
-       char linkbuffer[512];
-       // Should be PATH_MAX but that needs autconf support
+       char linkbuffer[PATH_MAX + 1];
        string const encoded = file.toFilesystemEncoding();
        int const nRead = ::readlink(encoded.c_str(),
                                     linkbuffer, sizeof(linkbuffer) - 1);