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

Bernhard Walle bernhard at bwalle.de
Wed Nov 25 18:37:08 EST 2009


Simon Horman schrieb:
>  
> +
> +	if ( NULL == p)
> +		return -1;

Wouldn't that be better 'p == NULL'?

> +	ret = strtol(line, &p, 10);
> +
> +	/* Too long */
> +	if (ret > INT_MAX)
> +		return -1;

An integer that can be represented in 2 (strlen("__\0")==3) cannot be
larger than INT_MAX on any platform I can imagine. ;-)




Regards,
Bernhard



More information about the kexec mailing list