Mercurial > hg > octave-nkf
diff src/load-save.cc @ 1728:42b4f904f1af
[project @ 1996-01-09 11:36:01 by jwe]
author | jwe |
---|---|
date | Tue, 09 Jan 1996 11:41:43 +0000 |
parents | a38bd8df9d33 |
children | a02f140ed897 |
line wrap: on
line diff
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -30,6 +30,8 @@ #include <cstring> #include <cctype> +#include <string> + #include <iostream.h> #include <fstream.h> #include <strstream.h> @@ -2512,9 +2514,9 @@ { FOUR_BYTE_INT len = chm.cols (); os.write (&len, 4); - const char *tmp = chm.row_as_string (i); + string tstr = chm.row_as_string (i); + const char *tmp = tstr.data (); os.write (tmp, len); - delete [] tmp; } } else if (tc.is_range ()) @@ -2819,9 +2821,9 @@ { int len = chm.cols (); os << "# length: " << len << "\n"; - char *tmp = chm.row_as_string (i); + string tstr = chm.row_as_string (i); + char *tmp = tstr.data (); os.write (tmp, len); - delete [] tmp; os << "\n"; } }