Permalink
Browse files

Fix point->draw() fails when no LABEL defined (closes #4572)

  • Loading branch information...
1 parent b240378 commit e794f6785ce6b0077e9964565298464d29d933ce Alan Boudreault committed Feb 6, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 mapdraw.c
  2. +2 −2 mapscript/php/point.c
View
@@ -2243,7 +2243,7 @@ int msDrawPoint(mapObj *map, layerObj *layer, pointObj *point, imageObj *image,
if(msScaleInBounds(map->scaledenom, theclass->styles[s]->minscaledenom, theclass->styles[s]->maxscaledenom))
msDrawMarkerSymbol(&map->symbolset, image, point, theclass->styles[s], layer->scalefactor);
}
- if(labeltext) {
+ if(labeltext && (strlen(labeltext)>0)) {
if(layer->labelcache) {
if(msAddLabel(map, label, layer->index, classindex, NULL, point, NULL, -1) != MS_SUCCESS) return(MS_FAILURE);
} else
@@ -354,7 +354,7 @@ PHP_METHOD(pointObj, draw)
{
zval *zobj = getThis();
zval *zmap, *zlayer, *zimage;
- char *text;
+ char *text = NULL;
long text_len;
long classIndex;
int status = MS_FAILURE;
@@ -364,7 +364,7 @@ PHP_METHOD(pointObj, draw)
php_image_object *php_image;
PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OOOls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OOOl|s",
&zmap, mapscript_ce_map,
&zlayer, mapscript_ce_layer,
&zimage, mapscript_ce_image,

0 comments on commit e794f67

Please sign in to comment.