summaryrefslogtreecommitdiff
path: root/render/box_construct.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-04-30 07:00:58 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-04-30 07:00:58 +0000
commit000e6ad3dea9fe04759c7d27ea9ae500eccdc4bc (patch)
treea8afaa98c8beab93ea2d383fba9b01ed6821946e /render/box_construct.c
parentb579b0deb39c067f19bebcb4acfb29d7ef87f258 (diff)
downloadnetsurf-000e6ad3dea9fe04759c7d27ea9ae500eccdc4bc.tar.gz
netsurf-000e6ad3dea9fe04759c7d27ea9ae500eccdc4bc.tar.bz2
It turns out that realloc(ptr, 0) --> free(ptr) is not actually required by the C standard (whereas realloc(NULL, size) --> malloc(size) is).
Therefore, explicitly model the behaviour expected by our libraries (that realloc of 0 size is equivalent to free). svn path=/trunk/netsurf/; revision=10524
Diffstat (limited to 'render/box_construct.c')
-rw-r--r--render/box_construct.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index f7d92079b..153bdd75b 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -813,12 +813,6 @@ bool box_construct_text(xmlNode *n, struct content *content,
return true;
}
-
-static void *ns_css_computed_style_alloc(void *ptr, size_t len, void *pw)
-{
- return realloc(ptr, len);
-}
-
/**
* Get the style for an element.
*
@@ -842,7 +836,7 @@ css_computed_style *box_get_style(struct content *c,
(uint8_t *) s, strlen(s),
c->data.html.encoding, content__get_url(c),
c->data.html.quirks != BINDING_QUIRKS_MODE_NONE,
- ns_css_computed_style_alloc, c);
+ box_style_alloc, NULL);
xmlFree(s);
@@ -853,7 +847,7 @@ css_computed_style *box_get_style(struct content *c,
/* Select partial style for element */
partial = nscss_get_style(c, n, CSS_PSEUDO_ELEMENT_NONE,
CSS_MEDIA_SCREEN, inline_style,
- ns_css_computed_style_alloc, c);
+ box_style_alloc, NULL);
/* No longer need inline style */
if (inline_style != NULL)