Skip to content
Permalink
Browse files
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/qgis@5609 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 17, 2006
1 parent 00275e3 commit d5da7842c7901b057b0c9e1b71b43b3cc647dfa3
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/providers/postgres/qgspostgresprovider.cpp
@@ -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
{

0 comments on commit d5da784

Please sign in to comment.