summaryrefslogtreecommitdiff
path: root/render/html.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-10-11 06:54:37 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-10-11 06:54:37 +0000
commitd4d866c43fd2f551e4a6f6ee44529b773997cf07 (patch)
tree73c3616a46d7980acde4f00811603d602fab123c /render/html.c
parent01c85524899587ddec9d9d4135b54b84907946c0 (diff)
downloadnetsurf-d4d866c43fd2f551e4a6f6ee44529b773997cf07.tar.gz
netsurf-d4d866c43fd2f551e4a6f6ee44529b773997cf07.tar.bz2
Fix crash when top-level content is not HTML and there is a fragment identifier in the URL.
Constify. svn path=/trunk/netsurf/; revision=10881
Diffstat (limited to 'render/html.c')
-rw-r--r--render/html.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/render/html.c b/render/html.c
index 8a1f67542..d074b58b9 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2220,14 +2220,16 @@ hlcache_handle *html_get_favicon(hlcache_handle *h)
* \param y Updated to global y coord iff id found
* \return true iff id found
*/
-bool html_get_id_offset(hlcache_handle *h, char *frag_id, int *x, int *y)
+bool html_get_id_offset(hlcache_handle *h, const char *frag_id, int *x, int *y)
{
struct box *pos;
- struct box *layout = html_get_box_tree(h);
+ struct box *layout;
if (content_get_type(h) != CONTENT_HTML)
return false;
+ layout = html_get_box_tree(h);
+
if ((pos = box_find_by_id(layout, frag_id)) != 0) {
box_coords(pos, x, y);
return true;