From 793d466edfa715e29b1d6141f42a7a837c4f446a Mon Sep 17 00:00:00 2001 From: John Tytgat Date: Sun, 25 May 2008 15:51:30 +0000 Subject: - introduction of SLEN() - enforce result of url_normalize() being NULL on failure - plug memory leak when url_normalize() fails svn path=/trunk/netsurf/; revision=4200 --- riscos/gui.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'riscos/gui.c') diff --git a/riscos/gui.c b/riscos/gui.c index f7173fe81..6e9aa28e6 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -1998,10 +1998,10 @@ char *path_to_url(const char *path) return NULL; } - memcpy(url, "file://", sizeof("file://")-1); + memcpy(url, "file://", SLEN("file://")); if (__unixify(buffer, __RISCOSIFY_NO_REVERSE_SUFFIX, - url + sizeof("file://")-1, - 1 - spare + 10 - (sizeof("file://")-1), + url + SLEN("file://"), + 1 - spare + 10 - SLEN("file://"), 0) == NULL) { LOG(("__unixify failed: %s", buffer)); free(buffer); @@ -2011,7 +2011,7 @@ char *path_to_url(const char *path) free(buffer); buffer = NULL; /* We don't want '/' to be escaped. */ - url_err = url_escape(url, sizeof("file://")-1, false, "/", &escurl); + url_err = url_escape(url, SLEN("file://"), false, "/", &escurl); free(url); url = NULL; if (url_err != URL_FUNC_OK) { LOG(("url_escape failed: %s", url)); -- cgit v1.2.3