Skip to content
Permalink
Browse files

Fix off-by-one error in chmd TOLOWER() fallback

  • Loading branch information...
kyz committed Feb 6, 2018
1 parent 0b0ef93 commit 4fd9ccaa54e1aebde1e4b95fb0163b699fd7bcc8
Showing with 6 additions and 1 deletion.
  1. +5 −0 libmspack/ChangeLog
  2. +1 −1 libmspack/mspack/chmd.c
@@ -1,3 +1,8 @@
2018-02-06 Stuart Caie <kyzer@cabextract.org.uk>

* chmd.c: fixed an off-by-one error in the TOLOWER() macro, reported
by Dmitry Glavatskikh. Thanks Dmitry!

2017-11-26 Stuart Caie <kyzer@cabextract.org.uk>

* kwajd_read_headers(): fix up the logic of reading the filename and
@@ -831,7 +831,7 @@ static int search_chunk(struct mschmd_header *chm,
# endif
# define TOLOWER(x) tolower(x)
#else
# define TOLOWER(x) (((x)<0||(x)>256)?(x):mspack_tolower_map[(x)])
# define TOLOWER(x) (((x)<0||(x)>255)?(x):mspack_tolower_map[(x)])
/* Map of char -> lowercase char for the first 256 chars. Generated with:
* LC_CTYPE=en_GB.utf-8 perl -Mlocale -le 'print map{ord(lc chr).","} 0..255'
*/

0 comments on commit 4fd9cca

Please sign in to comment.
You can’t perform that action at this time.