summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorJohn Tytgat <joty@netsurf-browser.org>2008-05-25 15:51:30 +0000
committerJohn Tytgat <joty@netsurf-browser.org>2008-05-25 15:51:30 +0000
commit793d466edfa715e29b1d6141f42a7a837c4f446a (patch)
tree7c18cdfe932ec3b48218d7d8ea1668cf438cc24c /riscos
parente89c34657381b70fa129475577e1c51c754d6be1 (diff)
downloadnetsurf-793d466edfa715e29b1d6141f42a7a837c4f446a.tar.gz
netsurf-793d466edfa715e29b1d6141f42a7a837c4f446a.tar.bz2
- 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
Diffstat (limited to 'riscos')
-rw-r--r--riscos/gui.c8
1 files changed, 4 insertions, 4 deletions
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));