Skip to content

Commit d454fdb

Browse files
author
g_j_m
committedJul 17, 2006
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
1 parent 452f166 commit d454fdb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,10 +817,9 @@ void QgsPostgresProvider::getFeatureGeometry(int key, QgsFeature *f)
817817

818818
if(returnedLength > 0)
819819
{
820-
unsigned char *wkbgeom = new unsigned char[returnedLength + 1];
821-
memset(wkbgeom, '\0', returnedLength + 1);
820+
unsigned char *wkbgeom = new unsigned char[returnedLength];
822821
memcpy(wkbgeom, PQgetvalue(geomResult, row, 0), returnedLength);
823-
f->setGeometryAndOwnership(wkbgeom, returnedLength + 1);
822+
f->setGeometryAndOwnership(wkbgeom, returnedLength);
824823
}
825824
else
826825
{

0 commit comments

Comments
 (0)