Package: jzip / 210r20001005d-2

standalone-unsigned-char Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Fix erroneous offset calculation caused by char signedness.

-- Niko Tyni <ntyni@iki.fi> Fri, 14 Jul 2006 20:40:54 +0300
Index: jzip-210r20001005/fileio.c
===================================================================
--- jzip-210r20001005.orig/fileio.c	2006-07-14 20:37:22.000000000 +0300
+++ jzip-210r20001005/fileio.c	2006-07-14 20:38:27.000000000 +0300
@@ -195,7 +195,9 @@
       /* standalone game; offset to story start is saved in low-endian */
       /* format after magic string */
       story_offset =
-            magic[MAGIC_END + 1] + magic[MAGIC_END + 2] * 256L + magic[MAGIC_END + 3] * 65536L;
+            (unsigned char) magic[MAGIC_END + 1] + 
+	    (unsigned char) magic[MAGIC_END + 2] * 256L + 
+	    (unsigned char) magic[MAGIC_END + 3] * 65536L;
    }
 
    strcpy( tmp, storyname );