# HG changeset patch # User Olaf Till # Date 1307025073 -7200 # Node ID 65b7ce254ba3057c1dff0f550b27e8cf783d3fa4 # Parent f66dacbeb7be6db220eb7d57a69223da791c9140 Fix loading of function handles saved in binary format. Bug #33456. * src/ov-fcn-handle.cc (load_binary): Replace is.get() with is.read(). diff -r f66dacbeb7be -r 65b7ce254ba3 src/ov-fcn-handle.cc --- a/src/ov-fcn-handle.cc Mon Jun 06 15:34:34 2011 -0400 +++ b/src/ov-fcn-handle.cc Thu Jun 02 16:31:13 2011 +0200 @@ -553,7 +553,10 @@ swap_bytes<4> (&tmp); OCTAVE_LOCAL_BUFFER (char, ctmp1, tmp+1); - is.get (ctmp1, tmp+1, 0); + // is.get (ctmp1, tmp+1, 0); caused is.eof () to be true though + // effectively not reading over file end + is.read (ctmp1, tmp); + ctmp1[tmp] = 0; nm = std::string (ctmp1); if (! is) @@ -578,7 +581,10 @@ swap_bytes<4> (&tmp); OCTAVE_LOCAL_BUFFER (char, ctmp2, tmp+1); - is.get (ctmp2, tmp+1, 0); + // is.get (ctmp2, tmp+1, 0); caused is.eof () to be true though + // effectively not reading over file end + is.read (ctmp2, tmp); + ctmp2[tmp] = 0; unwind_protect_safe frame; @@ -658,7 +664,7 @@ success = set_fcn (octaveroot, fpath); } - return success; + return success; } #if defined (HAVE_HDF5)