improper use of NULL in tools/ctf
There are a few improper uses of NULL in tools/ctf.
The attached patch fixes using NULL where:
- an integer type is expected either as a return value or to compare
with functions returning integers (like strchr, which returns an index not an address)
- the NULL character is not an address but a value (0 or rather '\\0')