From 9661e84371e570902229f6ae70e88f4d52c5684c Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Wed, 1 Feb 2006 22:31:27 +0000 Subject: [project @ 2006-02-01 22:31:27 by adrianl] Eliminate spurious char at end of imported text svn path=/import/netsurf/; revision=2052 --- riscos/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'riscos') diff --git a/riscos/window.c b/riscos/window.c index e0da79b3f..58a103255 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -2865,7 +2865,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename, return true; /* was for us, but it didn't work! */ } - buf = malloc(size + 1); /* allow room for NUL terminator */ + buf = malloc(size); if (!buf) { warn_user("NoMemory", NULL); return true; @@ -2881,7 +2881,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename, return true; } - ret = utf8_from_local_encoding(buf, size + 1, &utf8_buf); + ret = utf8_from_local_encoding(buf, size, &utf8_buf); if (ret != UTF8_CONVERT_OK) { /* bad encoding shouldn't happen */ assert(ret != UTF8_CONVERT_BADENC); -- cgit v1.2.3