summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2005-07-15 21:05:02 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2005-07-15 21:05:02 +0000
commit51700bf75e523e5b4da020953df3ad9056b42b6f (patch)
treee055a4a54b14b6cf7f810d9c3d7190a7eab0c533
parent866e0a7ea7269b74a9fffbd74a82bc1c66817a1f (diff)
downloadrockbox-51700bf75e523e5b4da020953df3ad9056b42b6f.tar.gz
rockbox-51700bf75e523e5b4da020953df3ad9056b42b6f.tar.bz2
rockbox-51700bf75e523e5b4da020953df3ad9056b42b6f.zip
iAudio: will also work on machines where a byte does not have 8 bits
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7161 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--tools/iaudio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/iaudio.c b/tools/iaudio.c
index 2c59b3cd55..715b3b6d23 100644
--- a/tools/iaudio.c
+++ b/tools/iaudio.c
@@ -59,7 +59,7 @@ int main (int argc, char* argv[]) {
/* print old checksum */
fseek (pFile, CHECKSUM_BIT, SEEK_SET);
byte = fgetc(pFile);
- printf("Old checksum: 0x%02x\n", (unsigned char) byte);
+ printf("Old checksum: 0x%02x\n", byte & 0xff);
/* get file size*/
fseek(pFile,0,SEEK_END);
@@ -85,7 +85,7 @@ int main (int argc, char* argv[]) {
for (i = CHECKSUM_START; i < length; i++) {
checksum += inbuf[i];
}
- printf("New checksum: 0x%02x\n", (unsigned char) checksum);
+ printf("New checksum: 0x%02x\n", checksum & 0xff);
/* save new checksum */
inbuf[CHECKSUM_BIT] = (unsigned char) checksum;