From a80248f204378cd6d6f04f9ccb61463fdb73df52 Mon Sep 17 00:00:00 2001 From: carl Date: Wed, 20 Feb 2019 00:44:32 +0800 Subject: [PATCH] * Was trying to use the new system API which is not ready causing stack issues. --- modules/src/input/inp_pkg.body | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/src/input/inp_pkg.body b/modules/src/input/inp_pkg.body index 9950f34dc..2a025cd52 100644 --- a/modules/src/input/inp_pkg.body +++ b/modules/src/input/inp_pkg.body @@ -107,7 +107,7 @@ INP_rdfile(fd, fn, size, pbuf) register long *size; char **pbuf; /* output parameter */ { - long rsize; + int rsize; if ( ((*size = sys_filesize(fn))) < 0 @@ -217,13 +217,12 @@ INP_rdblock(fd, buf, n) char *buf; int *n; { - long readSize; - readSize = (size_t)*n; - if (!sys_read(fd, buf, INP_BUFSIZE, &readSize)) { + + if (!sys_read(fd, buf, INP_BUFSIZE, n)) { return 0; } - *n = (int)readSize; + buf[*n] = '\0'; return 1; } -- 2.34.1