Skip to content

Commit

Permalink
Fix off-by-one error in chmd TOLOWER() fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
kyz committed Feb 6, 2018
1 parent 0b0ef93 commit 4fd9cca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions libmspack/ChangeLog
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion libmspack/mspack/chmd.c
Expand Up @@ -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'
*/
Expand Down

0 comments on commit 4fd9cca

Please sign in to comment.