[PATCH] Fixes divelogs.de upload error #483

Lubomir I. Ivanov neolit123 at gmail.com
Sat Apr 5 10:22:49 PDT 2014


On 5 April 2014 18:24, Thiago Macieira <thiago at macieira.org> wrote:
> Em sáb 05 abr 2014, às 12:20:25, Lubomir I. Ivanov escreveu:
>> the argument swap is my fault which originates back to the GTK version.
>> was not caught because we didn't use streamsize and only checked if
>> fread() succeeds.
>
> And I've never cared about the order. If you're trying to read N elements of
> size S, you're reading N*S bytes.
>
> And we all know "the order of the factors does not alter the product", so S*N
> is also valid.
>
> So how does this fix anything? What am I missing?
>

streamsize is later used to null terminate a buffer after the first
byte, because of the argument order.
membuf[streamsize] = 0;

lubomir
--


More information about the subsurface mailing list