cast long to int in tags.c
Ivan Skytte Jørgensen
isj-nedit-dev at i1.dk
Sat Feb 2 22:05:38 CET 2008
On Saturday 02 February 2008 21:41:00 Joerg Fischer wrote:
> in tags.c in the function 'static int nextTFBlock(FILE *fp,...' the
> int incLen, incPos, i, incLines;
>
> A bit later, the first use of incPos (inside a while loop parsing the
> contents of the calltips file fp) is
>
> incPos = ftell(fp);
>
> Is this correct? I mean, since ftell returns a long, the result could
> possibly get truncated, couldn't it?
True, the assignment may result in loss of significant bits, so 'incPos'
and 'incLen' should be longs. But in real life it only causes problems if the
tags file is larger than 2GB.
If your tags file is larger than 2GB then nedit is probably the least of you
problems :-)
There are many more problems like this. Look for 'Info 712' in the flexelint
output I provided 2007-10-13.
Regards,
Ivan
More information about the Develop
mailing list