Add generation for remaining, fix invalid fseek().
diff --git a/cper-parse.c b/cper-parse.c
index 0bc801e..1fd5f74 100644
--- a/cper-parse.c
+++ b/cper-parse.c
@@ -290,6 +290,9 @@
//Converts the section described by a single given section descriptor.
json_object* cper_section_to_ir(FILE* handle, EFI_ERROR_SECTION_DESCRIPTOR* descriptor)
{
+ //Save our current position in the stream.
+ long position = ftell(handle);
+
//Read section as described by the section descriptor.
fseek(handle, descriptor->SectionOffset, SEEK_SET);
void* section = malloc(descriptor->SectionLength);
@@ -302,6 +305,9 @@
return NULL;
}
+ //Seek back to our original position.
+ fseek(handle, position, SEEK_SET);
+
//Parse section to IR based on GUID.
json_object* result = NULL;
if (guid_equal(&descriptor->SectionType, &gEfiProcessorGenericErrorSectionGuid))