A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

mi4: Correct a build warning/error that pops up on stricter hosts

Change-Id: Ibf549472aa75a1f5e63eccb5ca7974dec506710f

+6 -6
+6 -6
tools/mi4.c
··· 118 118 } 119 119 fseek(file,0,SEEK_END); 120 120 length = ftell(file); 121 - 121 + 122 122 fseek(file,0,SEEK_SET); 123 123 124 124 /* Add 4 bytes to length (for magic), the 0x200 byte header and ··· 150 150 int2le(length+4, &outbuf[0x2e8]); /* length plus 0xaa55aa55 */ 151 151 152 152 int2le(0xaa55aa55, &outbuf[0x200+length]); /* More Magic */ 153 - 153 + 154 154 strncpy((char *)outbuf+0x1f8, type, 4); /* type of binary (RBBL, RBOS) */ 155 155 strncpy((char *)outbuf+0x1fc, model, 4); /* 4 character model id */ 156 - 156 + 157 157 /* Calculate CRC32 checksum */ 158 158 chksum_crc32gentab (); 159 159 crc = chksum_crc32 (outbuf+0x200,mi4length-0x200); 160 160 161 - strncpy((char *)outbuf, "PPOS", 4); /* Magic */ 161 + memcpy(outbuf, "PPOS", 4); /* Magic */ 162 162 int2le(version, &outbuf[0x04]); /* .mi4 version */ 163 163 int2le(length+4, &outbuf[0x08]); /* Length of firmware plus magic */ 164 164 int2le(crc, &outbuf[0x0c]); /* CRC32 of mi4 file */ ··· 168 168 169 169 /* v3 files require a dummy DSA signature */ 170 170 if (version == 0x00010301) { 171 - outbuf[0x2f]=0x01; 171 + outbuf[0x2f]=0x01; 172 172 } 173 173 174 174 file = fopen(oname, "wb"); ··· 176 176 perror(oname); 177 177 return -3; 178 178 } 179 - 179 + 180 180 len = fwrite(outbuf, 1, mi4length, file); 181 181 if(len < (size_t)length) { 182 182 perror(oname);