summaryrefslogtreecommitdiffstats
path: root/contrib/groff/src/roff/troff
diff options
context:
space:
mode:
authorbenl <benl@FreeBSD.org>2011-05-18 21:04:29 +0000
committerbenl <benl@FreeBSD.org>2011-05-18 21:04:29 +0000
commitbe96174f193f154a18117e3f36172d4a6632ee6b (patch)
tree13999d29e25b0e4b9974be8e9a492e86afe15606 /contrib/groff/src/roff/troff
parentcd538f65b0333c57b6e33e5bbae8f94517ac08cc (diff)
downloadFreeBSD-src-be96174f193f154a18117e3f36172d4a6632ee6b.zip
FreeBSD-src-be96174f193f154a18117e3f36172d4a6632ee6b.tar.gz
Fix clang warnings.
Note: possible minor security issues fixed (untrusted string used as printf format string). Approved by: philip (mentor)
Diffstat (limited to 'contrib/groff/src/roff/troff')
-rw-r--r--contrib/groff/src/roff/troff/mtsm.cpp6
-rw-r--r--contrib/groff/src/roff/troff/node.cpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/contrib/groff/src/roff/troff/mtsm.cpp b/contrib/groff/src/roff/troff/mtsm.cpp
index 630e973..38efc0a 100644
--- a/contrib/groff/src/roff/troff/mtsm.cpp
+++ b/contrib/groff/src/roff/troff/mtsm.cpp
@@ -611,14 +611,16 @@ int state_set::is_in(int_value_state i)
return (intset & (1 << (int)i)) != 0;
}
+// Note: this used to have a bug s.t. it always tested for bit 0 (benl 18/5/11)
int state_set::is_in(units_value_state u)
{
- return (unitsset & (1 << (int)u) != 0);
+ return (unitsset & (1 << (int)u)) != 0;
}
+// Note: this used to have a bug s.t. it always tested for bit 0 (benl 18/5/11)
int state_set::is_in(string_value_state s)
{
- return (stringset & (1 << (int)s) != 0);
+ return (stringset & (1 << (int)s)) != 0;
}
void state_set::add(units_value_state, int n)
diff --git a/contrib/groff/src/roff/troff/node.cpp b/contrib/groff/src/roff/troff/node.cpp
index 0d874d3..0e440b2 100644
--- a/contrib/groff/src/roff/troff/node.cpp
+++ b/contrib/groff/src/roff/troff/node.cpp
@@ -2157,7 +2157,7 @@ void glyph_node::debug_node()
if (c)
fprintf(stderr, "%c", c);
else
- fprintf(stderr, ci->nm.contents());
+ fputs(ci->nm.contents(), stderr);
if (push_state)
fprintf(stderr, " <push_state>");
if (state)
OpenPOWER on IntegriCloud