Skip to content

Commit

Permalink
Fix incorrect error return values in CAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Oct 27, 2018
1 parent 67d6eaf commit bfe6b8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions capi/geos_ts_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ GEOSFree_r (GEOSContextHandle_t extHandle, void* buffer)

//-----------------------------------------------------------
// relate()-related functions
// return 0 = false, 1 = true, 2 = error occured
// return 0 = false, 1 = true, 2 = error occurred
//-----------------------------------------------------------

char
Expand Down Expand Up @@ -1016,14 +1016,14 @@ GEOSisValidDetail_r(GEOSContextHandle_t extHandle, const Geometry *g,
{
if ( 0 == extHandle )
{
return 0;
return 2;
}

GEOSContextHandleInternal_t *handle = 0;
handle = reinterpret_cast<GEOSContextHandleInternal_t*>(extHandle);
if ( 0 == handle->initialized )
{
return 0;
return 2;
}

try
Expand Down Expand Up @@ -1378,7 +1378,7 @@ GEOSLength_r(GEOSContextHandle_t extHandle, const Geometry *g, double *length)

if ( 0 == extHandle )
{
return 2;
return 0;
}

GEOSContextHandleInternal_t *handle = 0;
Expand Down

0 comments on commit bfe6b8b

Please sign in to comment.