From: <sba...@us...> - 2023-06-03 04:37:45
|
This is an automated email from the git hooks/post-receive-user script. sbaldovi pushed a commit to branch master in repository libspectrum. View the commit online: https://sourceforge.net/p/fuse-emulator/libspectrum/ci/97175c357fbaefd0c17445c855b7b03746a9f9d9/ The following commit(s) were added to refs/heads/master by this push: new 97175c3 Move "for" loop initial declaration 97175c3 is described below commit 97175c357fbaefd0c17445c855b7b03746a9f9d9 Author: Sergio Baldoví <ser...@gm...> AuthorDate: Sat Jun 3 06:37:19 2023 +0200 Move "for" loop initial declaration Not allowed in C89 mode. Fix the build with old gcc versions. --- dsnap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dsnap.c b/dsnap.c index 512d71c..e7446bb 100644 --- a/dsnap.c +++ b/dsnap.c @@ -390,11 +390,14 @@ static void write_header( libspectrum_buffer *buffer, libspectrum_snap *snap, libspectrum_word sp ) { + short padding; + short b; + /* Header has 128B, but only last 24 bytes are used. Content before is irrelevant. Less by 10 chars - signature to flag snaphost created by fuse */ libspectrum_buffer_write( buffer, LIBSPECTRUM_DSNAP_SIGNATURE, strlen(LIBSPECTRUM_DSNAP_SIGNATURE) ); - short padding = LIBSPECTRUM_DSNAP_HEADER_LENGTH - 24 - strlen(LIBSPECTRUM_DSNAP_SIGNATURE) ; - for (short b=0; b < padding; b++) { + padding = LIBSPECTRUM_DSNAP_HEADER_LENGTH - 24 - strlen(LIBSPECTRUM_DSNAP_SIGNATURE); + for( b=0; b < padding; b++ ) { libspectrum_buffer_write_byte( buffer, 0 ); } |