gbranden pushed a commit to branch master
in repository groff.
commit 36a6a482610dfbc0a0dd35bf962b43ab7ead917a
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Feb 9 13:09:47 2023 -0600
[troff]: Fix latent bug in pointer comparison.
* src/roff/troff/input.cpp (token::next): Use correct kind of null
object in comparison. Fixes latent bug that would be exposed if we
were to migrate from zero literals to `nullptr`.
Seen in bjarnigroff at
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00083.html>.
---
ChangeLog | 6 ++++++
src/roff/troff/input.cpp | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index b5c347fb5..b1e1c2da2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-09 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (token::next): Use correct kind of
+ null object in comparison. Fixes latent bug that would be
+ exposed if we were to migrate from zero literals to `nullptr`.
+
2023-02-09 Deri James <[email protected]>
[gropdf] Parse multiple entries in 'papersize' as specified in
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 8779a78fe..292ee7389 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2069,7 +2069,7 @@ void token::next()
// environment::set_font warns if a bogus mounting position is
// requested. We must warn here if a bogus font name is
// selected.
- if (*p != 0 /* nullptr */ || s.is_empty()) {
+ if (*p != '\0' || s.is_empty()) {
if (!curenv->set_font(s))
warning(WARN_FONT, "cannot select font '%1'",
s.contents());
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit