diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-03-07 11:57:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-07 11:57:55 +0100 |
| commit | 4cc4e038bc9ac868156884f58b02d89849962f08 (patch) | |
| tree | 6402b7c11f07f3cc1aa06680a98b5935cc96872b /src/4D_api.cpp | |
| parent | 5b9d009293db4021b57a4949f467f2dd1081870a (diff) | |
| parent | e3b0dda249ad58ed6cf0f7ed44924659b9fee50f (diff) | |
| download | PROJ-4cc4e038bc9ac868156884f58b02d89849962f08.tar.gz PROJ-4cc4e038bc9ac868156884f58b02d89849962f08.zip | |
Merge pull request #2560 from rouault/coverityscan_fixes
Several fixes/improvements spotted by CoverityScan
Diffstat (limited to 'src/4D_api.cpp')
| -rw-r--r-- | src/4D_api.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp index 909c3c32..9c5b45f5 100644 --- a/src/4D_api.cpp +++ b/src/4D_api.cpp @@ -1610,7 +1610,7 @@ PJ_INFO proj_info (void) { /* build search path string */ auto ctx = pj_get_default_ctx(); - if (!ctx || ctx->search_paths.empty()) { + if (ctx->search_paths.empty()) { const auto searchpaths = pj_get_default_searchpaths(ctx); for( const auto& path: searchpaths ) { buf = path_append(buf, path.c_str(), &buf_size); @@ -1624,8 +1624,8 @@ PJ_INFO proj_info (void) { free(const_cast<char*>(info.searchpath)); info.searchpath = buf ? buf : empty; - info.paths = ctx ? ctx->c_compat_paths : nullptr; - info.path_count = ctx ? static_cast<int>(ctx->search_paths.size()) : 0; + info.paths = ctx->c_compat_paths; + info.path_count = static_cast<int>(ctx->search_paths.size()); pj_release_lock (); return info; |
