Skip to content

Commit

Permalink
cppcheck fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 6, 2022
1 parent 368e1e0 commit 58d46fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frmts/grib/gribdataset.cpp
Expand Up @@ -1193,7 +1193,7 @@ class InventoryWrapperSidecar : public gdal::grib::InventoryWrapper
else
{
inv_[i].subgNum =
static_cast<unsigned short>(strtol(aosNum[1], &endptr, 10));
static_cast<int>(strtol(aosNum[1], &endptr, 10));
if (*endptr != 0) goto err_sidecar;
if( inv_[i].subgNum <= 0 )
goto err_sidecar;
Expand Down
3 changes: 2 additions & 1 deletion ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp
Expand Up @@ -6338,7 +6338,8 @@ OGRGeometryTypeCounter* OGRGeoPackageTableLayer::GetGeometryTypes(
static int ProgressHandler(void* pData)
{
CancelCallback* psCancelCallback = static_cast<CancelCallback*>(pData);
return psCancelCallback->m_pfnProgress(0.0, "", psCancelCallback->m_pProgressData) ? 0 : 1;
return psCancelCallback->m_pfnProgress != nullptr &&
psCancelCallback->m_pfnProgress(0.0, "", psCancelCallback->m_pProgressData) ? 0 : 1;
}
};

Expand Down

0 comments on commit 58d46fd

Please sign in to comment.