comparison src/load-save.cc @ 2436:a628e881be66

[project @ 1996-10-29 22:08:28 by jwe]
author jwe
date Tue, 29 Oct 1996 22:10:39 +0000
parents dd29ab8af9e7
children 902f330e9584
comparison
equal deleted inserted replaced
2435:3be97fe02051 2436:a628e881be66
1147 error ("load: encountered complex matrix with string flag set!"); 1147 error ("load: encountered complex matrix with string flag set!");
1148 return 0; 1148 return 0;
1149 } 1149 }
1150 1150
1151 // LEN includes the terminating character, and the file is also 1151 // LEN includes the terminating character, and the file is also
1152 // supposed to include it. 1152 // supposed to include it, but apparently not all files do. Either
1153 1153 // way, I think this should work.
1154 name = new char [len]; 1154
1155 name = new char [len+1];
1155 if (! is.read (name, len)) 1156 if (! is.read (name, len))
1156 goto data_read_error; 1157 goto data_read_error;
1158 name[len] = '\0';
1157 1159
1158 dlen = nr * nc; 1160 dlen = nr * nc;
1159 if (dlen < 0) 1161 if (dlen < 0)
1160 goto data_read_error; 1162 goto data_read_error;
1161 1163