summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McGreevy <mamcgree@hdfgroup.org>2008-10-13 21:32:54 (GMT)
committerMike McGreevy <mamcgree@hdfgroup.org>2008-10-13 21:32:54 (GMT)
commit406e8dd434a62120b390b8b6dcf54c73fb561856 (patch)
tree22fc9ba02696fb833d7bef317db17565e35058d3
parent7cfab788fc243ccc493cc98f8c6e504ca42157d0 (diff)
downloadhdf5-406e8dd434a62120b390b8b6dcf54c73fb561856.zip
hdf5-406e8dd434a62120b390b8b6dcf54c73fb561856.tar.gz
hdf5-406e8dd434a62120b390b8b6dcf54c73fb561856.tar.bz2
[svn-r15857] Purpose: Bug fix
Description: The pre-parse of the journal file to determine maximum entry size (to determine proper memory allocation amount) didn't take into account incomplete entries at the end of the file. Modified to only parse up through the last complete entry, rather than the entire file. Tested: kagiso
-rw-r--r--tools/h5recover/h5recover.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/h5recover/h5recover.c b/tools/h5recover/h5recover.c
index bf6c1b7..b3c0de5 100644
--- a/tools/h5recover/h5recover.c
+++ b/tools/h5recover/h5recover.c
@@ -489,6 +489,7 @@ main (int argc, const char *argv[])
if ( fgetc(journal_fp) == '3' ) {
last_trans_found = 1;
+ pos_end = ftell(journal_fp);
fseek(journal_fp, -1, SEEK_CUR);
fgets(last_trans_msg, 50, journal_fp);
@@ -517,9 +518,6 @@ main (int argc, const char *argv[])
/* - max EOA size (for superblock update, to preserve raw data) */
/* ================================================================= */
- fseek(journal_fp, 0, SEEK_END);
- pos_end = ftell(journal_fp);
-
fseek(journal_fp, 0, SEEK_SET);
c_new = 0;