diff options
author | marha <marha@users.sourceforge.net> | 2013-10-01 12:33:20 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-10-01 12:33:20 +0200 |
commit | be0d35a4a1b1dc5bde14d1b027f4f0cb58b5a779 (patch) | |
tree | 807b5640d1fedc88ddcda752f101ffdb3071092a /libXpm/src/RdFToBuf.c | |
parent | 11b60c4ebaf348b01051bfff19f947b073028a99 (diff) | |
parent | 6dd755aa923291db2501cc5c22e409c41a70e3c1 (diff) | |
download | vcxsrv-be0d35a4a1b1dc5bde14d1b027f4f0cb58b5a779.tar.gz vcxsrv-be0d35a4a1b1dc5bde14d1b027f4f0cb58b5a779.tar.bz2 vcxsrv-be0d35a4a1b1dc5bde14d1b027f4f0cb58b5a779.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
Update following packages:
Conflicts:
X11/Xwinsock.h
apps/xhost/xhost.c
libXaw/src/Vendor.c
libXfont/include/X11/fonts/bdfint.h
libXfont/src/fontfile/catalogue.c
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 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 |