You've already forked fuse-utils
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:
@@ -600,3 +600,5 @@
|
||||
libspectrum_buffer in tape APIs (Fred).
|
||||
20160831 listbasic.c,rzxtool.c,snapconv.c,utils.c: switch to using
|
||||
libspectrum_buffer in snapshot write APIs (Fred).
|
||||
20160905 rzxtool.c: switch to using libspectrum_buffer in RZX write APIs
|
||||
(Fred).
|
||||
|
20
rzxtool.c
20
rzxtool.c
@@ -454,19 +454,19 @@ parse_options( int argc, char **argv, GSList **actions,
|
||||
static int
|
||||
write_rzx( const char *filename, libspectrum_rzx *rzx, int compressed )
|
||||
{
|
||||
unsigned char *buffer = NULL; size_t length = 0;
|
||||
int error;
|
||||
libspectrum_buffer *buffer = libspectrum_buffer_alloc();
|
||||
int error = 0;
|
||||
|
||||
error = libspectrum_rzx_write( &buffer, &length, rzx, LIBSPECTRUM_ID_UNKNOWN,
|
||||
creator, compressed, NULL );
|
||||
if( error ) return error;
|
||||
error = libspectrum_rzx_write( buffer, rzx, LIBSPECTRUM_ID_UNKNOWN, creator,
|
||||
compressed, NULL );
|
||||
if( error != 0 ) {
|
||||
error = write_file( libspectrum_buffer_get_data( buffer ),
|
||||
libspectrum_buffer_get_data_size( buffer ), filename );
|
||||
}
|
||||
|
||||
error = write_file( buffer, length, filename );
|
||||
if( error ) { free( buffer ); return error; }
|
||||
libspectrum_buffer_free( buffer );
|
||||
|
||||
free( buffer );
|
||||
|
||||
return 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
int
|
||||
|
Reference in New Issue
Block a user