Andreas Wehrmann wrote:
>>On 12/11/2015 08:51 AM, Anton Botvalde wrote:
>> Hello,
>>
>> In the largepost.c example the iterate_post callback has a bug in fwrite >-
>>    if (size > 0)
>>      {
>>        if (!fwrite (data, size, sizeof (char), con_info->fp))
>>          return MHD_NO;
>>      }
>>
>> should be
>>
>>    if (size > 0)
>>      {
>>        if (!fwrite (data, sizeof (char), size , con_info->fp))
>>          return MHD_NO;
>>      }

>If I'm not mistaken if shouldn't matter at all because sizeof(char) is 1
>by definition.

It never matters whether sizeof(char) is 1 or not (it is), because in
practise the two are just multiplied together and the total written out.

In principle it is wrong though.  You are writing out size chars,
not 1 object that is size bytes long.


Reply via email to