gbranden pushed a commit to branch master
in repository groff.
commit 3f5e7d26ea27bfe716ff32eacd6eaaa9aaf44e01
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 23 22:04:42 2026 -0600
[grotty]: Fix fatal diagnostic message text.
* src/devices/grotty/tty.cpp (tty_printer::add_char): Report correct
size of failed memory allocation. We don't need `nlines` times the
size of a `tty_glyph` structure, but `nlines` times the size of a
_pointer_ to such a structure.
Continues commit 112ec43851, 20 November, fixing Savannah #68942.
---
ChangeLog | 10 ++++++++++
src/devices/grotty/tty.cpp | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 26a50cbcb..12cf1ceeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-11-23 G. Branden Robinson <[email protected]>
+
+ * src/devices/grotty/tty.cpp (tty_printer::add_char): Report
+ correct size of failed memory allocation. We don't need
+ `nlines` times the size of a `tty_glyph` structure, but `nlines`
+ times the size of a _pointer_ to such a structure.
+
+ Continues commit 112ec43851, 20 November, fixing Savannah
+ #68942.
+
2026-11-23 G. Branden Robinson <[email protected]>
* src/devices/grotty/tty.cpp (tty_printer::add_char): Stop
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index 135d27879..4cb87618a 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -440,7 +440,7 @@ void tty_printer::add_char(output_character c, int w,
}
catch (const std::bad_alloc &e) {
fatal("cannot allocate %1 bytes to render %2 lines"
- " of terminal output", (new_nlines * sizeof(tty_glyph)),
+ " of terminal output", (new_nlines * sizeof(tty_glyph *)),
new_nlines);
}
memset(lines, 0, new_nlines * sizeof(tty_glyph *));
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit