1
0
mirror of https://git.code.sf.net/p/fuse-emulator/fuse-utils synced 2025-08-07 13:42:58 +03:00

Switch to using libspectrum_buffer in libspectrum_rzx_write().

Legacy-ID: 5792
This commit is contained in:
Fredrick Meunier
2016-09-05 12:17:05 +00:00
parent 87e0351fe3
commit 2388396d6a
2 changed files with 12 additions and 10 deletions

View File

@@ -600,3 +600,5 @@
libspectrum_buffer in tape APIs (Fred). libspectrum_buffer in tape APIs (Fred).
20160831 listbasic.c,rzxtool.c,snapconv.c,utils.c: switch to using 20160831 listbasic.c,rzxtool.c,snapconv.c,utils.c: switch to using
libspectrum_buffer in snapshot write APIs (Fred). libspectrum_buffer in snapshot write APIs (Fred).
20160905 rzxtool.c: switch to using libspectrum_buffer in RZX write APIs
(Fred).

View File

@@ -454,19 +454,19 @@ parse_options( int argc, char **argv, GSList **actions,
static int static int
write_rzx( const char *filename, libspectrum_rzx *rzx, int compressed ) write_rzx( const char *filename, libspectrum_rzx *rzx, int compressed )
{ {
unsigned char *buffer = NULL; size_t length = 0; libspectrum_buffer *buffer = libspectrum_buffer_alloc();
int error; int error = 0;
error = libspectrum_rzx_write( &buffer, &length, rzx, LIBSPECTRUM_ID_UNKNOWN, error = libspectrum_rzx_write( buffer, rzx, LIBSPECTRUM_ID_UNKNOWN, creator,
creator, compressed, NULL ); compressed, NULL );
if( error ) return error; if( error != 0 ) {
error = write_file( libspectrum_buffer_get_data( buffer ),
libspectrum_buffer_get_data_size( buffer ), filename );
}
error = write_file( buffer, length, filename ); libspectrum_buffer_free( buffer );
if( error ) { free( buffer ); return error; }
free( buffer ); return error;
return 0;
} }
int int