Please use NULL instead of 0 whenever you have a pointer!
ron%brl-vgr at sri-unix.UUCP
ron%brl-vgr at sri-unix.UUCP
Fri Jan 27 05:15:01 AEST 1984
From: Ron Natalie <ron at brl-vgr>
This is wrong if you want to be strict about things:
execl("/bin/echo", "echo", "hi", "there", 0);
And so is this!
execl("/bin/echo", "echo", "hi", "there", NULL);
in system V (and most everything else) as NULL really is 0.
You are only guaranteed of being allowed to mix 0 and pointers
in assignment (that's with an equals, not passing to functions)
and comparison. The correct way is:
execl("/bin/echo", "echo", "hi", "there", (char *)0);
Because execl's arguments must be character pointers not ints!
-Ron
More information about the Comp.unix.wizards
mailing list