From: Paul Ramsey Date: Wed, 7 Mar 2012 17:40:39 +0000 (+0000) Subject: ST_Summary output contains a spurious "+" sign (#1663) X-Git-Tag: 2.0.0beta2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca7f754260ca4d216c6af7441026c4ea6e9e358b;p=postgis ST_Summary output contains a spurious "+" sign (#1663) git-svn-id: http://svn.osgeo.org/postgis/trunk@9420 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwgeom_debug.c b/liblwgeom/lwgeom_debug.c index d612e5e43..2464645cc 100644 --- a/liblwgeom/lwgeom_debug.c +++ b/liblwgeom/lwgeom_debug.c @@ -46,7 +46,7 @@ lwpoint_summary(LWPOINT *point, int offset) result = (char *)lwalloc(128+offset); - sprintf(result, "%*.s%s[%s]\n", + sprintf(result, "%*.s%s[%s]", offset, pad, lwtype_name(point->type), zmflags); return result; @@ -61,7 +61,7 @@ lwline_summary(LWLINE *line, int offset) result = (char *)lwalloc(128+offset); - sprintf(result, "%*.s%s[%s] with %d points\n", + sprintf(result, "%*.s%s[%s] with %d points", offset, pad, lwtype_name(line->type), zmflags, line->points->npoints); @@ -76,6 +76,7 @@ lwcollection_summary(LWCOLLECTION *col, int offset) char *result; char *tmp; int i; + static char *nl = "\n"; char *pad=""; char *zmflags = lwtype_flagchars(col->flags); @@ -95,6 +96,7 @@ lwcollection_summary(LWCOLLECTION *col, int offset) result = lwrealloc(result, size); LWDEBUGF(4, "Reallocated %d bytes for result", size); + if ( i > 0 ) strcat(result,nl); strcat(result, tmp); lwfree(tmp); @@ -113,6 +115,7 @@ lwpoly_summary(LWPOLY *poly, int offset) char *result; int i; char *pad=""; + static char *nl = "\n"; char *zmflags = lwtype_flagchars(poly->flags); LWDEBUG(2, "lwpoly_summary called"); @@ -126,8 +129,9 @@ lwpoly_summary(LWPOLY *poly, int offset) for (i=0; inrings; i++) { - sprintf(tmp,"%s ring %i has %i points\n", + sprintf(tmp,"%s ring %i has %i points", pad, i, poly->rings[i]->npoints); + if ( i > 0 ) strcat(result,nl); strcat(result,tmp); }