M
michaelp
Hello!
I am running gcc 2.95 on linux debian, and have come across some strange
behavior.
I have an expression like this:
if (
*charVariable == "\0"
||
strncmp(charVariable, anotherCharVariable, 2) == 0
)
{
//do something
}
When charVariable is null, I expect the construct not to attempt at
evaluating the next sub-expression. It seems to me that it does,
resulting in a segmentation fault.
Is it possible to control this behavior?
Michael
I am running gcc 2.95 on linux debian, and have come across some strange
behavior.
I have an expression like this:
if (
*charVariable == "\0"
||
strncmp(charVariable, anotherCharVariable, 2) == 0
)
{
//do something
}
When charVariable is null, I expect the construct not to attempt at
evaluating the next sub-expression. It seems to me that it does,
resulting in a segmentation fault.
Is it possible to control this behavior?
Michael