[Mono-dev] libgdiplus-2.8 - no need to go long long

Alexander Shulgin alexander.shulgin at yessoftware.com
Mon Oct 11 11:58:20 EDT 2010


On 11.10.2010 18:56, Ralph Leckett wrote:
> In libgdiplus-2.8, the following is dumb:
>
> 	unsigned long long int size;
>
> 	size = bmi.biWidth;
> 	size *= 4;
> 	if (size>  G_MAXINT32)
> 		goto error;
>
> The following is a better way:
>
> 	long size;
>
> 	size = bmi.biWidth;
> 	if (size>  G_MAXINT32 / 4)
> 		goto error;
> 	size *= 4;

Yes, you are right, but make it a patch, so a committer won't need to 
find the file and line where to change this.

--
Alex


More information about the Mono-devel-list mailing list