summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-06-06 22:48:26 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-06-07 02:50:30 +0000
commitff665a26d698b3e0aa89b33835e2cb0c6ede2fc3 (patch)
tree97f1f072190b8b9d7cbdba39c16b7ac14ea26f8d
parent2434b6ca258e43e61e6493911c08a5778f25728e (diff)
downloadrockbox-ff665a2.tar.gz
rockbox-ff665a2.zip
mi4: Correct a build warning/error that pops up on stricter hosts
Change-Id: Ibf549472aa75a1f5e63eccb5ca7974dec506710f
-rw-r--r--tools/mi4.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/mi4.c b/tools/mi4.c
index 52f043469f..cf052be6eb 100644
--- a/tools/mi4.c
+++ b/tools/mi4.c
@@ -118,7 +118,7 @@ int mi4_encode(char *iname, char *oname, int version, int magic,
}
fseek(file,0,SEEK_END);
length = ftell(file);
-
+
fseek(file,0,SEEK_SET);
/* Add 4 bytes to length (for magic), the 0x200 byte header and
@@ -150,15 +150,15 @@ int mi4_encode(char *iname, char *oname, int version, int magic,
int2le(length+4, &outbuf[0x2e8]); /* length plus 0xaa55aa55 */
int2le(0xaa55aa55, &outbuf[0x200+length]); /* More Magic */
-
+
strncpy((char *)outbuf+0x1f8, type, 4); /* type of binary (RBBL, RBOS) */
strncpy((char *)outbuf+0x1fc, model, 4); /* 4 character model id */
-
+
/* Calculate CRC32 checksum */
chksum_crc32gentab ();
crc = chksum_crc32 (outbuf+0x200,mi4length-0x200);
- strncpy((char *)outbuf, "PPOS", 4); /* Magic */
+ memcpy(outbuf, "PPOS", 4); /* Magic */
int2le(version, &outbuf[0x04]); /* .mi4 version */
int2le(length+4, &outbuf[0x08]); /* Length of firmware plus magic */
int2le(crc, &outbuf[0x0c]); /* CRC32 of mi4 file */
@@ -168,7 +168,7 @@ int mi4_encode(char *iname, char *oname, int version, int magic,
/* v3 files require a dummy DSA signature */
if (version == 0x00010301) {
- outbuf[0x2f]=0x01;
+ outbuf[0x2f]=0x01;
}
file = fopen(oname, "wb");
@@ -176,7 +176,7 @@ int mi4_encode(char *iname, char *oname, int version, int magic,
perror(oname);
return -3;
}
-
+
len = fwrite(outbuf, 1, mi4length, file);
if(len < (size_t)length) {
perror(oname);