File: standalone-unsigned-char

package info (click to toggle)
jzip 210r20001005d-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,164 kB
  • sloc: ansic: 11,699; sh: 32; makefile: 27
file content (18 lines) | stat: -rw-r--r-- 816 bytes parent folder | download | duplicates (6)
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 );