# HG changeset patch # User John W. Eaton # Date 1247330770 14400 # Node ID 5a68e3e748c58cc198f14adae2347974f7c273fc # Parent 48d3e2d261e6fee53cf95df6cfa1349b41080e0e file-ops.cc (file_ops::symlink, file_ops::readlink): avoid incorrectly sized buffer diff -r 48d3e2d261e6 -r 5a68e3e748c5 liboctave/file-ops.cc --- a/liboctave/file-ops.cc Thu Jul 09 15:04:34 2009 -0400 +++ b/liboctave/file-ops.cc Sat Jul 11 12:46:10 2009 -0400 @@ -210,13 +210,7 @@ #if defined (HAVE_SYMLINK) - OCTAVE_LOCAL_BUFFER (char, old_nm, old_name.length ()); - OCTAVE_LOCAL_BUFFER (char, new_nm, new_name.length ()); - - strcpy (old_nm, old_name.c_str ()); - strcpy (new_nm, new_name.c_str ()); - - status = ::symlink (old_nm, new_nm); + status = ::symlink (old_name.c_str (), new_name.c_str ()); if (status < 0) { @@ -250,11 +244,7 @@ #if defined (HAVE_READLINK) char buf[MAXPATHLEN+1]; - OCTAVE_LOCAL_BUFFER (char, p, path.length ()); - - strcpy (p, path.c_str ()); - - status = ::readlink (p, buf, MAXPATHLEN); + status = ::readlink (path.c_str (), buf, MAXPATHLEN); if (status < 0) {