Skip to content

Commit 4fd9cca

Browse files
committed
Fix off-by-one error in chmd TOLOWER() fallback
1 parent 0b0ef93 commit 4fd9cca

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: libmspack/ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2018-02-06 Stuart Caie <kyzer@cabextract.org.uk>
2+
3+
* chmd.c: fixed an off-by-one error in the TOLOWER() macro, reported
4+
by Dmitry Glavatskikh. Thanks Dmitry!
5+
16
2017-11-26 Stuart Caie <kyzer@cabextract.org.uk>
27

38
* kwajd_read_headers(): fix up the logic of reading the filename and

Diff for: libmspack/mspack/chmd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ static int search_chunk(struct mschmd_header *chm,
831831
# endif
832832
# define TOLOWER(x) tolower(x)
833833
#else
834-
# define TOLOWER(x) (((x)<0||(x)>256)?(x):mspack_tolower_map[(x)])
834+
# define TOLOWER(x) (((x)<0||(x)>255)?(x):mspack_tolower_map[(x)])
835835
/* Map of char -> lowercase char for the first 256 chars. Generated with:
836836
* LC_CTYPE=en_GB.utf-8 perl -Mlocale -le 'print map{ord(lc chr).","} 0..255'
837837
*/

0 commit comments

Comments
 (0)