To make memory_size bigger than file_size, set memory_size prior calling 'save' function

This commit is contained in:
Serge Lamikhov-Center 2012-06-24 08:50:29 +03:00
parent b3b7aed245
commit 2cddbab258
2 changed files with 3 additions and 2 deletions

View File

@ -479,7 +479,8 @@ class elfio
}
segments[i]->set_file_size( current_data_pos - current_file_pos );
segments[i]->set_memory_size( current_data_pos - current_file_pos );
segments[i]->set_memory_size( current_data_pos - current_file_pos +
segments[i]->get_memory_size() );
segments[i]->save( f, (std::streamoff)segment_header_position, (std::streamoff)current_file_pos );
current_file_pos = current_data_pos;
segment_header_position += header->get_segment_entry_size();