diff options
-rw-r--r-- | src/CheckpointRecovery.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/CheckpointRecovery.c b/src/CheckpointRecovery.c index efbad8f..d35e551 100644 --- a/src/CheckpointRecovery.c +++ b/src/CheckpointRecovery.c @@ -609,7 +609,8 @@ int IOUtil_RecoverParameters (int (*recoverFn) (cGH *GH, filelist = tmp; filelist[num_files].basename = strdup (file->d_name); /* cut the filename after the iteration number field */ - filelist[num_files].basename[p - file->d_name] = 0; + len = p - file->d_name; + filelist[num_files].basename[len] = 0; filelist[num_files].iteration = atoi (file->d_name + recover_file_len+4); num_files++; |