1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-16 10:38:06 -05:00
Simon Tatham 322984d635 do_text_internal: fix bug in the lpDx_maybe mechanism.
lpDx_maybe was a pointer defined to point at either lpDx itself or
NULL, depending on whether the code decided it needed to pass the lpDx
array of per-character pixel offsets to various functions during
drawing (based in turn on whether the font was variable-pitch).

lpDx is reallocated as necessary, which means lpDx_maybe must be kept
up to date. This was achieved by resetting it to lpDx if it was
already non-NULL.

But lpDx starts out as NULL before the first reallocation, so that
this can't work - it'll be initialised to NULL even if we _did_ want
to use it, and then at the first realloc, it won't be updated!

Before the previous commit turned lpDx from a static into an automatic
variable, this would have been a rare bug affecting only the first
call to the function. Now it will happen all the time, which is
better, because we can notice and fix it.

Replaced lpDx_maybe completely with a boolean flag indicating whether
we should pass lpDx to drawing functions.
2023-05-27 17:43:02 +01:00
..
2023-03-15 19:40:23 +00:00
2021-05-27 09:48:32 +01:00
2022-08-03 20:48:46 +01:00
2022-09-03 11:59:12 +01:00
2017-05-07 16:29:01 +01:00