summaryrefslogtreecommitdiff
path: root/src/RdFToBuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/RdFToBuf.c')
-rw-r--r--src/RdFToBuf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/RdFToBuf.c b/src/RdFToBuf.c
index b719960..8501d23 100644
--- a/src/RdFToBuf.c
+++ b/src/RdFToBuf.c
@@ -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