Commit 4ffb0319 authored by Michael Meeks's avatar Michael Meeks
Browse files

Fix bug with '.gnumeric' files.

parent d838fc55
1999-05-13 Michael Meeks <michael@imaginator.com>
* ms-ole.c (ms_ole_new, ms_ole_create, ms_ole_deanalyse):
Fatal bug with uninitialised arrays fixed.
1999-05-12 Michael Meeks <michael@imaginator.com>
* ms-ole.c (free_allocation): Major hassles here with
......
......@@ -419,11 +419,14 @@ static void
ms_ole_deanalyse (MS_OLE *f)
{
g_return_if_fail (f);
g_array_free (f->header.sbd_list, TRUE);
if (f->header.sbd_list)
g_array_free (f->header.sbd_list, TRUE);
f->header.sbd_list = NULL;
g_array_free (f->header.sbf_list, TRUE);
if (f->header.sbf_list)
g_array_free (f->header.sbf_list, TRUE);
f->header.sbf_list = NULL;
g_array_free (f->header.root_list, TRUE);
if (f->header.root_list)
g_array_free (f->header.root_list, TRUE);
f->header.root_list = NULL;
}
......@@ -454,6 +457,9 @@ ms_ole_create (const char *name)
}
f = g_new0 (MS_OLE, 1);
f->header.sbd_list = 0;
f->header.sbf_list = 0;
f->header.root_list = 0;
f->file_descriptor = file;
fstat(file, &st);
f->length = st.st_size;
......@@ -562,6 +568,10 @@ ms_ole_new (const char *name)
printf ("New OLE file '%s'\n", name);
f = g_new0 (MS_OLE, 1);
f->header.sbd_list = 0;
f->header.sbf_list = 0;
f->header.root_list = 0;
f->file_descriptor = file = open (name, O_RDWR);
f->mode = 'w';
if (file == -1) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment