On Fri, 12 May 2017, [email protected] wrote:

On Thu, 11 May 2017, Bruce Dubbs wrote:

The '\0' is an old way to check for a null string. It probably can be fixed with

strlen(top.do_check) == 0

or possibly

top.do_check == (char*)'\0'

But I doubt this was the intention. It seems more likely the author wanted to compare with an empty string just as he did 5 lines above:
*top.do_check == '\0'
I do have an even better and context free argument for that:
The author explicitly tried to compare with a character literal. This does make much sense for a dereferenced char pointer, but it does make no sense for the pointer itself. Which is exactly what the compiler is complaining about. If he wanted to compare the pointer, he would have compared it with 0 or NULL. So by far the best explanation is a missing *.

Uwe
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to