[Bf-committers] Possible bug, uninitialized var in depsgraph.c
bjornmose
bjornmose at gmx.net
Wed Jul 13 19:17:37 CEST 2005
Ton Roosendaal wrote:
> Hi,
>
>> subtarget= "";
>> ...
>>
>> target = get_constraint_target(con,
>> &subtarget);
>> // didn't check but i think this sets subtarget to be a valid pointer
>> OR NULL
>> .....
>> if(subtarget[0]) <-- MSCV6 build stalls here since subtarget is NULL
>> ( trying to READ OUT the first element subtarget points to and
>> reading out a NULL pointer seems illegal to MSVC6 and me )
>
>
> Hrms... I'm used to have strings initialized that way. For example:
>
> char *str= "blahblah";
>
> should make "str" a pointer to a static array.
> Using an empty string "" should give a pointer too, with the first
> element being zero?
you're right, initializing a
char *pc;
with
pc = "blah";
is entirely OK, even in MSVC6 :)
i was confusing it with a strcpy().
OLE
More information about the Bf-committers
mailing list