aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2017-02-08 17:39:36 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2017-02-08 17:39:36 +1100
commit00d7bb1f4b0e3578c69c126fa6c50a7897c4524f (patch)
tree8900ba3da779084ef5970e98a0980546b76721cf
parent95d57726bca42fdedf63178a46a15599c02b60cc (diff)
downloaddtc-00d7bb1f4b0e3578c69c126fa6c50a7897c4524f.zip
dtc-00d7bb1f4b0e3578c69c126fa6c50a7897c4524f.tar.gz
dtc-00d7bb1f4b0e3578c69c126fa6c50a7897c4524f.tar.bz2
dtc: pos parameter to srcpos_string() can't be NULL
None of the callers ever pass a NULL to srcpos_string(), so the check for it is not necessary. Furthermore, checking it make Coverity complain about the raw dereferences which follow later in the function. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--srcpos.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/srcpos.c b/srcpos.c
index aa3aad0..9d38459 100644
--- a/srcpos.c
+++ b/srcpos.c
@@ -252,7 +252,7 @@ srcpos_string(struct srcpos *pos)
const char *fname = "<no-file>";
char *pos_str;
- if (pos)
+ if (pos->file && pos->file->name)
fname = pos->file->name;