See above - if you are relying on NULL - ptr yielding a -ve integer, I think you are not safe.