[GRASS-SVN] r33973 - grass/branches/develbranch_6/db/drivers/postgres

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 22 08:22:24 EDT 2008


Author: mlennert
Date: 2008-10-22 08:22:24 -0400 (Wed, 22 Oct 2008)
New Revision: 33973

Modified:
   grass/branches/develbranch_6/db/drivers/postgres/listtab.c
Log:
fix bug #93


Modified: grass/branches/develbranch_6/db/drivers/postgres/listtab.c
===================================================================
--- grass/branches/develbranch_6/db/drivers/postgres/listtab.c	2008-10-22 10:08:14 UTC (rev 33972)
+++ grass/branches/develbranch_6/db/drivers/postgres/listtab.c	2008-10-22 12:22:24 UTC (rev 33973)
@@ -6,7 +6,7 @@
 
 int db__driver_list_tables(dbString ** tlist, int *tcount, int system)
 {
-    int i, nrows, trows, vrows, ncols, tablecol, tschemacol, viewcol,
+    int i, j, nrows, trows, vrows, ncols, tablecol, tschemacol, viewcol,
 	vschemacol;
     dbString *list;
     PGresult *rest, *resv;
@@ -94,15 +94,16 @@
     PQclear(rest);
 
 
-    for (i = 0; i < vrows; i++) {
+    for (j = 0; j < vrows; j++) {
 	if (vschemacol >= 0) {
-	    sprintf(buf, "%s.%s", (char *)PQgetvalue(resv, i, vschemacol),
-		    (char *)PQgetvalue(resv, i, viewcol));
+	    sprintf(buf, "%s.%s", (char *)PQgetvalue(resv, j, vschemacol),
+		    (char *)PQgetvalue(resv, j, viewcol));
 	}
 	else {
-	    sprintf(buf, "%s", (char *)PQgetvalue(resv, i, viewcol));
+	    sprintf(buf, "%s", (char *)PQgetvalue(resv, j, viewcol));
 	}
 	db_set_string(&list[i], buf);
+	i++;
     }
 
     PQclear(resv);



More information about the grass-commit mailing list