lwpoint_summary(LWPOINT *point, int offset)
{
char *result;
- char pad[offset+1];
-
- memset(pad, ' ', offset);
- pad[offset] = '\0';
+ char *pad="";
result = lwalloc(128+offset);
- sprintf(result, "%s%s[%s]\n",
- pad, lwgeom_typename(TYPE_GETTYPE(point->type)),
+ sprintf(result, "%*.s%s[%s]\n",
+ offset, pad, lwgeom_typename(TYPE_GETTYPE(point->type)),
lwgeom_typeflags(point->type));
return result;
}
lwline_summary(LWLINE *line, int offset)
{
char *result;
- char pad[offset+1];
-
- memset(pad, ' ', offset);
- pad[offset] = '\0';
+ char *pad="";
result = lwalloc(128+offset);
- sprintf(result, "%s%s[%s] with %d points\n",
- pad, lwgeom_typename(TYPE_GETTYPE(line->type)),
+ sprintf(result, "%*.s%s[%s] with %d points\n",
+ offset, pad, lwgeom_typename(TYPE_GETTYPE(line->type)),
lwgeom_typeflags(line->type),
line->points->npoints);
return result;
char *result;
char *tmp;
int i;
- char pad[offset+1];
- memset(pad, ' ', offset);
- pad[offset] = '\0';
+ char *pad="";
#ifdef PGIS_DEBUG_CALLS
lwnotice("lwcollection_summary called");
result = (char *)lwalloc(size);
- sprintf(result, "%s%s[%s] with %d elements\n",
- pad, lwgeom_typename(TYPE_GETTYPE(col->type)),
+ sprintf(result, "%*.s%s[%s] with %d elements\n",
+ offset, pad, lwgeom_typename(TYPE_GETTYPE(col->type)),
lwgeom_typeflags(col->type),
col->ngeoms);
tmp = lwgeom_summary(col->geoms[i], offset+2);
size += strlen(tmp)+1;
result = lwrealloc(result, size);
- //lwnotice("Reallocated %d bytes for result", size);
+#if PGIS_DEBUG > 1
+ lwnotice("Reallocated %d bytes for result", size);
+#endif
strcat(result, tmp);
lwfree(tmp);
}
size_t size = 64*(poly->nrings+1)+128;
char *result;
int i;
- char pad[offset+1];
- memset(pad, ' ', offset);
- pad[offset] = '\0';
+ char *pad="";
#ifdef PGIS_DEBUG_CALLS
lwnotice("lwpoly_summary called");
result = lwalloc(size);
- sprintf(result, "%s%s[%s] with %i rings\n",
- pad, lwgeom_typename(TYPE_GETTYPE(poly->type)),
+ sprintf(result, "%*.s%s[%s] with %i rings\n",
+ offset, pad, lwgeom_typename(TYPE_GETTYPE(poly->type)),
lwgeom_typeflags(poly->type),
poly->nrings);