summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
Diffstat (limited to 'riscos')
-rw-r--r--riscos/textselection.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/riscos/textselection.c b/riscos/textselection.c
index 5215a62c9..2c8520425 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -392,9 +392,6 @@ bool ro_gui_selection_prepare_paste_dataload(
wimp_full_message_data_xfer *dataxfer)
{
FILE *fp;
- long size;
- char *local_cb;
- nserror ret;
/* Ignore messages that aren't for us */
if (dataxfer->your_ref == 0 || dataxfer->your_ref != paste_prev_message)
@@ -402,13 +399,15 @@ bool ro_gui_selection_prepare_paste_dataload(
fp = fopen(dataxfer->file_name, "r");
if (fp != NULL) {
+ long size;
fseek(fp, 0, SEEK_END);
size = ftell(fp);
fseek(fp, 0, SEEK_SET);
if (size > 0) {
- local_cb = malloc(size);
+ char *local_cb = malloc(size);
if (local_cb != NULL) {
+ nserror ret;
fread(local_cb, 1, size, fp);
ret = utf8_from_local_encoding(local_cb, size,