summaryrefslogtreecommitdiffstats
path: root/tbl_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-30 02:09:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-30 02:09:04 +0000
commitbba48934f08def48237c6f8c8f3f11d6e6d61944 (patch)
tree1801c761d155158b14223c4c46660b1082b9a217 /tbl_term.c
parent35e9f47f34b339929e0d02faa183381045c2b46c (diff)
downloadmandoc-bba48934f08def48237c6f8c8f3f11d6e6d61944.tar.gz
Auditing the tbl(7) code for more NULL pointer accesses, i came out
empty-handed; so this is just KNF and some code simplifications, no functional change.
Diffstat (limited to 'tbl_term.c')
-rw-r--r--tbl_term.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tbl_term.c b/tbl_term.c
index b139397d..949cfaff 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -262,11 +262,10 @@ tbl_data(struct termp *tp, const struct tbl_opts *opts,
const struct roffcol *col)
{
- if (NULL == dp) {
+ if (dp == NULL) {
tbl_char(tp, ASCII_NBRSP, col->width);
return;
}
- assert(dp->layout);
switch (dp->pos) {
case TBL_DATA_NONE:
@@ -396,8 +395,7 @@ tbl_number(struct termp *tp, const struct tbl_opts *opts,
psz = term_strlen(tp, buf);
- if (NULL != (cp = strrchr(dp->string, opts->decimal))) {
- buf[1] = '\0';
+ if ((cp = strrchr(dp->string, opts->decimal)) != NULL) {
for (ssz = 0, i = 0; cp != &dp->string[i]; i++) {
buf[0] = dp->string[i];
ssz += term_strlen(tp, buf);