summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-09 13:09:47 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-09 13:09:47 -0600
commit36a6a482610dfbc0a0dd35bf962b43ab7ead917a (patch)
tree4985185f7e528c795212a5757db6bff06b4f3542 /src
parent6e9518c1eb2fb1ab06d58a65947707290f43e857 (diff)
downloadgroff-git-36a6a482610dfbc0a0dd35bf962b43ab7ead917a.tar.gz
[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>.
Diffstat (limited to 'src')
-rw-r--r--src/roff/troff/input.cpp2
1 files changed, 1 insertions, 1 deletions
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());