[GRASS-SVN] r55735 - grass/branches/develbranch_6/display/d.what.rast

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 13 03:37:52 PDT 2013


Author: hamish
Date: 2013-04-13 03:37:52 -0700 (Sat, 13 Apr 2013)
New Revision: 55735

Modified:
   grass/branches/develbranch_6/display/d.what.rast/main.c
Log:
avoid using variables uninit'd (merge from relbr64)

Modified: grass/branches/develbranch_6/display/d.what.rast/main.c
===================================================================
--- grass/branches/develbranch_6/display/d.what.rast/main.c	2013-04-13 10:29:46 UTC (rev 55734)
+++ grass/branches/develbranch_6/display/d.what.rast/main.c	2013-04-13 10:37:52 UTC (rev 55735)
@@ -136,6 +136,7 @@
     if (D_do_conversions(&window, t, b, l, r))
 	G_fatal_error(_("Error in calculating conversions"));
 
+    width = mwidth = 0;
     if (rast) {
 	for (i = 0; rast[i]; i++) ;
 	nrasts = i;
@@ -146,7 +147,6 @@
 	cats =
 	    (struct Categories *)G_malloc(nrasts * sizeof(struct Categories));
 
-	width = mwidth = 0;
 	for (i = 0; i < nrasts; i++) {
 	    name[i] = (char *)G_malloc(GNAME_MAX);
 	    mapset[i] = (char *)G_malloc(GMAPSET_MAX);



More information about the grass-commit mailing list