On 26 Apr 2004, Bill Pringlemeir wrote:
>>> bpp = v->file_size / (v->context->width);
>>> -> s_from = chunk->from / bpp;
>>> s_to = chunk->to / bpp;
Hans de Graaff wrote:
>> Both v->file_size and v->context->width should not be 0 in this
>> code, that is something that the calling code should take care of.
On Tue, 27 Apr 2004, [EMAIL PROTECTED] wrote:
> What if v->file_size < v->context->width?
Correct. File size was 8 bytes and v->context->width was 640. I
crashes X-Windows twice and GTKG several times before I actually
inserted a printf before the calculation.
printf("v->file_size %d, v->context->width %d\n",
v->file_size , v->context->width);
The values cause an underflow in the division and the result is zero.
This would seem to happen for any file that is less than the size of
the display. Most people wouldn't download such small files.
I am pretty sure that I had a crash when I was moving files, but
perhaps it wasn't related to the same thing; in any case, it was an
earlier CVS version. Sorry to lead you down the wrong path.
Search for "readme" and sort by size. Download some small file (42
bytes) and it will crash without purge, etc. Just clicking on the
file in the "fileinfo" tab will cause the problem. Which makes a lot
of sense from the code... plus now I know what the colours mean ;-).
fwiw,
Bill Pringlemeir.
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel