gbranden pushed a commit to branch master
in repository groff.
commit 0a8aa3216c2ea888b7d5415f16f1c9e969898fa5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Aug 28 19:27:21 2024 -0500
[libgroff]: Handle failure if `NDEBUG` defined.
* src/libs/libgroff/unicode.cpp (valid_unicode_code_sequence): Return a
null pointer after `assert()` call, in the event someone compiles with
`NDEBUG` defined.
---
ChangeLog | 6 ++++++
src/libs/libgroff/unicode.cpp | 1 +
2 files changed, 7 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index a71af4cc0..5ffab3dec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-28 G. Branden Robinson <[email protected]>
+
+ * src/libs/libgroff/unicode.cpp (valid_unicode_code_sequence):
+ Return a null pointer after `assert()` call, in the event
+ someone compiles with `NDEBUG` defined.
+
2024-08-25 G. Branden Robinson <[email protected]>
* src/roff/troff/env.h: Trivially refactor `environment` class.
diff --git a/src/libs/libgroff/unicode.cpp b/src/libs/libgroff/unicode.cpp
index 675709a6b..97cde4469 100644
--- a/src/libs/libgroff/unicode.cpp
+++ b/src/libs/libgroff/unicode.cpp
@@ -57,6 +57,7 @@ const char *valid_unicode_code_sequence(const char *u, char
*errbuf)
}
else {
assert(0 == "unhandled hexadecimal digit character");
+ return 0 /* nullptr */;
}
// biggest Unicode value is U+10FFFF
if (val > 0x10FFFF) {
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit