summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2015-07-19 11:49:57 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2015-07-19 11:49:57 +0100
commit5ea99617371386a99fe9ddc4759b310069ae8440 (patch)
tree0e0c89e6c7b47ec1c6b0f3c5eac9660ae609cd9d /riscos
parent80e9a23fc10b0749e3daede512557e7202e438bb (diff)
downloadnetsurf-5ea99617371386a99fe9ddc4759b310069ae8440.tar.gz
netsurf-5ea99617371386a99fe9ddc4759b310069ae8440.tar.bz2
RISCOS: further fix URL bar memory manipulation
Diffstat (limited to 'riscos')
-rw-r--r--riscos/gui/url_bar.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index 9dbb3a5d1..6003fe309 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -183,6 +183,7 @@ struct url_bar *ro_gui_url_bar_create(struct theme_descriptor *theme)
return NULL;
}
url_bar->text_buffer[0] = 0;
+ url_bar->text_buffer_utf8 = NULL;
url_bar->hidden = false;
@@ -516,6 +517,9 @@ void ro_gui_url_bar_destroy(struct url_bar *url_bar)
if (url_bar->text_buffer_utf8 != NULL)
free(url_bar->text_buffer_utf8);
+ if (url_bar->text_buffer != NULL)
+ free(url_bar->text_buffer);
+
free(url_bar);
}
@@ -981,8 +985,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
*/
if (strlen(local_url) >= url_bar->text_size) {
- strncpy(url_bar->text_buffer, "", url_bar->text_size - 1);
- url_bar->text_buffer[url_bar->text_size - 1] = '\0';
+ url_bar->text_buffer[0] = '\0';
warn_user("LongURL", NULL);
LOG("Long URL (%d chars): %s", strlen(url), url);
} else {