[GRASS-SVN] r52844 - grass/branches/develbranch_6/raster/r.report
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Aug 22 13:45:54 PDT 2012
Author: mmetz
Date: 2012-08-22 13:45:54 -0700 (Wed, 22 Aug 2012)
New Revision: 52844
Modified:
grass/branches/develbranch_6/raster/r.report/header.c
grass/branches/develbranch_6/raster/r.report/label.c
Log:
r.report: fix for #970
Modified: grass/branches/develbranch_6/raster/r.report/header.c
===================================================================
--- grass/branches/develbranch_6/raster/r.report/header.c 2012-08-22 20:45:05 UTC (rev 52843)
+++ grass/branches/develbranch_6/raster/r.report/header.c 2012-08-22 20:45:54 UTC (rev 52844)
@@ -72,11 +72,9 @@
divider("|");
- label = nlayers > 1 ? "MAPS:" : "MAP:";
- len1 = strlen(label) + 1;
-
mask = maskinfo();
label = "MASK:";
+ len1 = strlen(label) + 1;
while (mask) {
fprintf(stdout, "|%-*s", len1, label);
label = "";
@@ -91,6 +89,7 @@
*/
label = nlayers > 1 ? "MAPS:" : "MAP:";
+ len1 = strlen(label) + 1;
for (i = 0; i < nlayers; i++) {
char *title;
Modified: grass/branches/develbranch_6/raster/r.report/label.c
===================================================================
--- grass/branches/develbranch_6/raster/r.report/label.c 2012-08-22 20:45:05 UTC (rev 52843)
+++ grass/branches/develbranch_6/raster/r.report/label.c 2012-08-22 20:45:54 UTC (rev 52844)
@@ -1,5 +1,7 @@
#include <string.h>
#include <stdio.h>
+#include <grass/gis.h>
+#include <grass/glocale.h>
char *print_label(char *s, int len, int pflag, int spacing, int dot)
{
@@ -7,6 +9,11 @@
int n;
int i;
+ if (len <= 0) {
+ G_warning(_("Page width is too small"));
+ return NULL;
+ }
+
/* strip away leading spaces */
while (*s == ' ')
s++;
More information about the grass-commit
mailing list