diff options
author | marha <marha@users.sourceforge.net> | 2013-10-01 12:23:16 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-10-01 12:28:08 +0200 |
commit | 6dd755aa923291db2501cc5c22e409c41a70e3c1 (patch) | |
tree | fa88a321afc13657f7687a25d466f49151c9599a /libXpm/src/RdFToBuf.c | |
parent | a5391fdea94a7b827069c6f926f83a235076ccb4 (diff) | |
download | vcxsrv-6dd755aa923291db2501cc5c22e409c41a70e3c1.tar.gz vcxsrv-6dd755aa923291db2501cc5c22e409c41a70e3c1.tar.bz2 vcxsrv-6dd755aa923291db2501cc5c22e409c41a70e3c1.zip |
Update following packages:
libXpm-3.5.11
libXaw-1.0.12
libXfont-1.4.6
libXrender-0.9.8
xproto-7.0.24
inputproto-2.3
xclock-1.0.7
xhost-1.0.6
Diffstat (limited to 'libXpm/src/RdFToBuf.c')
-rw-r--r-- | libXpm/src/RdFToBuf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libXpm/src/RdFToBuf.c b/libXpm/src/RdFToBuf.c index b719960af..7f8ebee61 100644 --- a/libXpm/src/RdFToBuf.c +++ b/libXpm/src/RdFToBuf.c @@ -60,7 +60,7 @@ 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 |