On 19 July 2011 18:08, Rodolfo kix Garcia <[email protected]> wrote:

> On Tue, 19 Jul 2011 07:23:34 +0800, Paul Harris wrote:
>
>> On 19 July 2011 01:40, Rodolfo kix Garcia  wrote:
>>
>>  On 17/07/11 12:05, Christophe CURIS wrote:
>>>
>>>  Hello,
>>>>
>>>> I was happy to discover that WindowMaker is still alive! So
>>>> please find
>>>> attached my very modest contribution to the aventure.
>>>>
>>>> Basically, there were some cases of "strncpy" usages that could
>>>> lead to a
>>>> missing NUL terminator, so this should help.
>>>>
>>>> Regards,
>>>> Christophe
>>>>
>>>
>>> Hi,
>>>
>>> is this line correct?
>>>
>>> +                       title[MAX_WORKSPACENAME_WIDTH] =
>>> 0;
>>>
>>> or is:
>>>
>>> +                       title[MAX_WORKSPACENAME_WIDTH] =
>>> '';
>>>
>>
>> Those two lines are equivalent.
>> '' is equal to zero.
>>
>>
>> Links:
>> ------
>> [1] mailto:[email protected]
>>
>
> Umm,
>
> I never see that. But 0 is int and '\0' is char. it should show a warning,
> not?
>
>
\0 is equal to zero.

as for why can you do something like
char b = 0;
I think its the same reason as why you can do
unsigned long x = 0;

its not like we are recasting it to an int and then assigning it...
this would be bad
*((int*)title[x]) = 0;

Reply via email to