aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit8ea5dc6d40c942157256ddd510bd3fa16cb44303 (patch)
tree79e6a90e244253f4314dc4dc3773abea58b3d267 /tbl_term.c
parent8330e5fd370ea4633052bdaece49563be0db086b (diff)
downloadmandoc-8ea5dc6d40c942157256ddd510bd3fa16cb44303.tar.gz
mandoc-8ea5dc6d40c942157256ddd510bd3fa16cb44303.tar.zst
mandoc-8ea5dc6d40c942157256ddd510bd3fa16cb44303.zip
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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tbl_term.c b/tbl_term.c
index 9b6aea36..160f3baa 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_term.c,v 1.34 2015/01/28 04:19:35 schwarze Exp $ */
+/* $Id: tbl_term.c,v 1.35 2015/01/30 02:09:04 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);