1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Fix misuse of FALSE for null pointer return values.

x11_char_struct returns a pointer or NULL, so while returning FALSE
would have ended up doing the right thing after macro expansion and
integer->pointer conversion, it wasn't actually how I _meant_ to spell
a failure return.
This commit is contained in:
Simon Tatham 2018-10-29 07:23:32 +00:00
parent 23e98b0afb
commit 1d459fc725

View File

@ -388,13 +388,13 @@ static const XCharStruct *x11_char_struct(
*/
if (byte2 < xfs->min_char_or_byte2 || byte2 > xfs->max_char_or_byte2)
return FALSE;
return NULL;
if (xfs->min_byte1 == 0 && xfs->max_byte1 == 0) {
index = byte2 - xfs->min_char_or_byte2;
} else {
if (byte1 < xfs->min_byte1 || byte1 > xfs->max_byte1)
return FALSE;
return NULL;
index = ((byte2 - xfs->min_char_or_byte2) +
((byte1 - xfs->min_byte1) *
(xfs->max_char_or_byte2 - xfs->min_char_or_byte2 + 1)));