# HG changeset patch # User John W. Eaton # Date 1247330770 14400 # Node ID bfc7b000a22953c2d35daa3ef8617f524c058421 # Parent 4a8d93bafe9c9d83461998fde1ecb14fd872e5a4 file-ops.cc (file_ops::symlink, file_ops::readlink): avoid incorrectly sized buffer diff -r 4a8d93bafe9c -r bfc7b000a229 liboctave/file-ops.cc --- a/liboctave/file-ops.cc Thu Jul 09 15:48:48 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) {