aboutsummaryrefslogtreecommitdiff
path: root/libXpm/src/RdFToBuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libXpm/src/RdFToBuf.c')
-rw-r--r--libXpm/src/RdFToBuf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libXpm/src/RdFToBuf.c b/libXpm/src/RdFToBuf.c
index bbd5dfb93..485e666c7 100644
--- a/libXpm/src/RdFToBuf.c
+++ b/libXpm/src/RdFToBuf.c
@@ -60,7 +60,7 @@ typedef long off_t;
int
XpmReadFileToBuffer(
- char *filename,
+ const char *filename,
char **buffer_return)
{
int fd, fcheck;
@@ -98,12 +98,12 @@ XpmReadFileToBuffer(
fclose(fp);
#ifdef VMS
/* VMS often stores text files in a variable-length record format,
- where there are two bytes of size followed by the record. fread
- converts this so it looks like a record followed by a newline.
- Unfortunately, the size reported by fstat() (and fseek/ftell)
- counts the two bytes for the record terminator, while fread()
- counts only one. So, fread() sees fewer bytes in the file (size
- minus # of records) and thus when asked to read the amount
+ where there are two bytes of size followed by the record. fread
+ converts this so it looks like a record followed by a newline.
+ Unfortunately, the size reported by fstat() (and fseek/ftell)
+ counts the two bytes for the record terminator, while fread()
+ counts only one. So, fread() sees fewer bytes in the file (size
+ minus # of records) and thus when asked to read the amount
returned by stat(), it fails.
The best solution, suggested by DEC, seems to consider the length
returned from fstat() as an upper bound and call fread() with