Dereferencing NULL
ron%brl-vgr at sri-unix.UUCP
ron%brl-vgr at sri-unix.UUCP
Thu Dec 1 06:16:11 AEST 1983
From: Ron Natalie <ron at brl-vgr>
Actually, on a VAX running BSD dereferencing NULL had best give you
zero. A large amount of the code depends on it (I'm not saying this
is a good idea, it's just the way it is). For example, the only reason
you can use a zero as an argument to IOCTL where it is expecting either
a zero or a pointer to some number is not because it ever checks for
null pointers but because it happens to work because *0 == 0.
-Ron
More information about the Comp.unix.wizards
mailing list