diff options
-rw-r--r-- | riscos/window.c | 4 |
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); |