summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Oliver Stöneberg <firewave@users.noreply.github.com>2014-03-29 12:36:11 +0000
committer Oliver Stöneberg <firewave@users.noreply.github.com>2014-03-29 12:36:11 +0000
commit06ab983049ea4f2bfd3192a3223199b7d7f8e550 (patch)
tree83efb0f77494d3579c0275716be7f2e886f2f50b /src/lib
parentd6a32473f465f9f009e0bd7b7f76ce885787c3f8 (diff)
converted some more global_alloc_array() usage to dynamic_array/dynamic_buffer (nw)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/apridisk.c8
-rw-r--r--src/lib/formats/ipf_dsk.c1
2 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/formats/apridisk.c b/src/lib/formats/apridisk.c
index 985177cc916..12f3d366011 100644
--- a/src/lib/formats/apridisk.c
+++ b/src/lib/formats/apridisk.c
@@ -6,7 +6,7 @@
#include "apridisk.h"
#include "imageutl.h"
-#include "corealloc.h"
+#include "coretmpl.h"
/***************************************************************************
CONSTANTS
@@ -177,7 +177,7 @@ FLOPPY_CONSTRUCT( apridisk_construct )
}
else if (compression == APR_COMPRESSED)
{
- UINT8 *buffer = (UINT8 *)global_alloc_array(UINT8, data_size);
+ dynamic_buffer buffer(data_size);
UINT16 length;
UINT8 value;
@@ -186,12 +186,10 @@ FLOPPY_CONSTRUCT( apridisk_construct )
length = pick_integer_le(buffer, 0, 2);
value = pick_integer_le(buffer, 2, 1);
- global_free_array(buffer);
-
/* not sure if this is possible */
if (length != 512) {
printf("Compression unsupported");
- exit(-1);
+ exit(-1); // TODO: NO!
}
memset(&tag->sectors[cur_sector].data, value, length);
diff --git a/src/lib/formats/ipf_dsk.c b/src/lib/formats/ipf_dsk.c
index 52e196911bd..e98c8e046c1 100644
--- a/src/lib/formats/ipf_dsk.c
+++ b/src/lib/formats/ipf_dsk.c
@@ -86,6 +86,7 @@ bool ipf_format::parse(UINT8 *data, UINT32 size, floppy_image *image)
if(res)
res = generate_tracks(image);
global_free_array(tinfos);
+ tinfos = NULL;
return res;
}