diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2017-02-08 17:39:36 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-02-08 17:39:36 +1100 |
commit | 00d7bb1f4b0e3578c69c126fa6c50a7897c4524f (patch) | |
tree | 8900ba3da779084ef5970e98a0980546b76721cf /srcpos.c | |
parent | 95d57726bca42fdedf63178a46a15599c02b60cc (diff) | |
download | dtc-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>
Diffstat (limited to 'srcpos.c')
-rw-r--r-- | srcpos.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |