Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove an unnecessary \0 pad to the end of the wkb char*. Also fix a
bug whereby the first byte after the wkb array was being set to \0


git-svn-id: http://svn.osgeo.org/qgis/trunk@5609 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 17, 2006
1 parent 452f166 commit d454fdb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -817,10 +817,9 @@ void QgsPostgresProvider::getFeatureGeometry(int key, QgsFeature *f)

if(returnedLength > 0)
{
unsigned char *wkbgeom = new unsigned char[returnedLength + 1];
memset(wkbgeom, '\0', returnedLength + 1);
unsigned char *wkbgeom = new unsigned char[returnedLength];
memcpy(wkbgeom, PQgetvalue(geomResult, row, 0), returnedLength);
f->setGeometryAndOwnership(wkbgeom, returnedLength + 1);
f->setGeometryAndOwnership(wkbgeom, returnedLength);
}
else
{
Expand Down

0 comments on commit d454fdb

Please sign in to comment.