summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Lees <adrian@aemulor.com>2006-02-01 22:31:27 +0000
committerAdrian Lees <adrian@aemulor.com>2006-02-01 22:31:27 +0000
commit9661e84371e570902229f6ae70e88f4d52c5684c (patch)
tree58b51233180bcff2e66f49d253c6237034f65b27
parent158b6e1835be9558aad0c4201d7f29d0be12aec2 (diff)
downloadnetsurf-9661e84371e570902229f6ae70e88f4d52c5684c.tar.gz
netsurf-9661e84371e570902229f6ae70e88f4d52c5684c.tar.bz2
[project @ 2006-02-01 22:31:27 by adrianl]
Eliminate spurious char at end of imported text svn path=/import/netsurf/; revision=2052
-rw-r--r--riscos/window.c4
1 files changed, 2 insertions, 2 deletions
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);