Mail Archives: cygwin/2000/02/01/23:28:17
Using beta 20.1 under win95 and NT, but have also checked Mumit Khan's beta
version of mingw - problem still resides there in source. Actually using
cygwin1.dll snapshot around Oct. 15, 1999. (Or somewhere shortly after that
buffer overrun fix.)
I was trying to read binary resource (.res) to produce readable output with
command similar to
./windres ./xxx.res
where the file ./xxx.res was produced by the MS RC.
I have found the function
res_align_file()
in source module resres.c does not function properly failing in the
following cases to force the required dword alignment: ftell(fres)==1, or
ftell(fres)==3. It will align properly if ftell(fres) == 2 , or
ftell(fres)==4.
A suggested replacement version of the function is:
static void
res_align_file(void)
{
int rem = ftell(fres) % 4 ;
if (rem)
if (fseek (fres, 4 - rem, SEEK_CUR) != 0)
fatal ("%s: %s: unable to align file", program_name, filename) ;
}
Someone in a position to do so may wish to examine this and make this
correction or a similar one before a new release.
I will also note that the function is used for alignment on output. From my
reading of the spec., I didn't think ANSI required the fseek seek beyond the
current end-of-file, but it appears this function counts on that (and it
apparently does work that way with cygwin.)
Even after I have made this change (and I'll check back to see if someone
thinks this is incorrect), I am still having a problem, apparently trying to
read a versioninfo structure, with a failure from the module resbin.c on the
error message containing the substring "%d != %d + %d". The values it shows
are indeed not equal, and I have not had sufficient time to chase this down.
I did recently take another look, and am now suspicious of code elsewhere,
as this .RES file does not appear to actually have a versioninfo item in
it... I think that's what the code around that error message was trying to
read.
David Hoke
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -