[PATCH] kexec.c: workaround getline and fscanf to make it *libc agnostic. Tested against klibc and dietlibc.

Yuri Bushmelev jay4mail at gmail.com
Thu Nov 26 05:34:10 EST 2009


Hello!
> On Thu, Nov 26, 2009 at 12:37:08AM +0100, Bernhard Walle wrote:
> > Simon Horman schrieb:
> > > +
> > > +	if ( NULL == p)
> > > +		return -1;
> >
> > Wouldn't that be better 'p == NULL'?
> 
> Agreed

That is form of 'early bug detection' of mistyped '=='.
E.g. you can write by mistype
	if (p = NULL) {}
but can't
	if (NULL = p) {}
because you will get compiler error.

-- 
Yuri Bushmelev



More information about the kexec mailing list