From 265bfdd32396f35149f77d97acf4cbf36eb59468 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 8 Oct 2011 12:22:29 +0000 Subject: Avoid a strlen. svn path=/trunk/netsurf/; revision=13004 --- desktop/browser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 5df2ac849..e0de594fb 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -1976,7 +1976,7 @@ void browser_window_refresh_url_bar(struct browser_window *bw, nsurl *url, */ gui_window_set_url(bw->window, nsurl_access(url)); } else { - url_buf = malloc(strlen(nsurl_access(url)) + 1 /* # */ + + url_buf = malloc(nsurl_length(url) + 1 /* # */ + strlen(frag) + 1 /* \0 */); if (url_buf != NULL) { /* This sprintf is safe because of the above size -- cgit v1.2.3