In the metric test is a call to ncnmetric, which eventually calls
snprintf. Along the way is a size that is much larger than the actual
bufsize, but it shouldn't matter as the buffer size exceeds what we
print (or at least what is expected).
In testing with glibc 2.37 on armhf on Ubuntu Lunar, I found that these
metric tests can fail with some unexpected truncation of the values.
For example, in the following check,
```
impericize_ncmetric(0, 1, buf, 0, 1000, '\0');
CHECK(!strcmp("0.00", buf));
```
buf would actually be "0.0".
Using a more realistic buffer size produces a working result.
There are small typos in:
- src/demo/fission.c
- src/tests/wide.cpp
Fixes:
- Should read `obliterated` rather than `oblitrated`.
- Should read `range` rather than `reange`.
We were checking for an off-plane cursor destination on
the X axis when it was provided explicitly, but not when
-1 was used to indicate the current position (contradicting
the comment immediately above the test). We also want to do
so when we're using the current position, though in this
case scrolling must be taken into account. Also, we were
placing the cursor on such a validation failure, despite not
intending to write anything.
Not testing for a current x (the -1 case) usually worked
because it was thrown out by ncplane_move_cursor_yx() below.
That fails, however, when we're working with an EGC that's
more than one column.
Delicate!
ncplane_putc_yx() calls ncplane_put() using an EGC extracted
from its nccell argument. The very act of writing that cell
to the plane, however, can grow the plane's underlying EGCpool,
possibly invalidating this reference. This was showing up as
a unit test failure on macOS, and was hopefully also the cause
of unit test failures on Alpine i686. Do a quick heap copy of
the EGC in ncplane_putc_yx(), and free it after writing to the
plane. Shouldn't cost anything (there was no measurable
impact in my testing). Closes#2420.