[GRASS-SVN] r47746 - grass/trunk/lib/db/dbmi_base

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 18 11:55:54 EDT 2011


Author: martinl
Date: 2011-08-18 08:55:54 -0700 (Thu, 18 Aug 2011)
New Revision: 47746

Modified:
   grass/trunk/lib/db/dbmi_base/connect.c
Log:
dbmi: zero dbConnection in db_get_connection()


Modified: grass/trunk/lib/db/dbmi_base/connect.c
===================================================================
--- grass/trunk/lib/db/dbmi_base/connect.c	2011-08-18 15:49:09 UTC (rev 47745)
+++ grass/trunk/lib/db/dbmi_base/connect.c	2011-08-18 15:55:54 UTC (rev 47746)
@@ -69,10 +69,12 @@
 {
   /* TODO: add checks and return DB_* error code if needed */
 
-    connection->driverName = G__getenv2("DB_DRIVER", G_VAR_MAPSET);
-    connection->databaseName = G__getenv2("DB_DATABASE", G_VAR_MAPSET);
-    connection->schemaName = G__getenv2("DB_SCHEMA", G_VAR_MAPSET);
-    connection->group = G__getenv2("DB_GROUP", G_VAR_MAPSET);
+    G_zero(connection, sizeof(dbConnection));
+    
+    connection->driverName = (char *)G__getenv2("DB_DRIVER", G_VAR_MAPSET);
+    connection->databaseName = (char *)G__getenv2("DB_DATABASE", G_VAR_MAPSET);
+    connection->schemaName = (char *)G__getenv2("DB_SCHEMA", G_VAR_MAPSET);
+    connection->group = (char *)G__getenv2("DB_GROUP", G_VAR_MAPSET);
 
     /* below commented due to new mechanism:
        connection->hostName = G__getenv("DB_HOST");



More information about the grass-commit mailing list