Re: [PATCH 1/2] MIPS: FW: Fix parsing u-boot environment

Sergei Shtylyov
2014-11-07T12:43:15Z

Hello.

On 11/7/2014 2:23 PM, Alban Bedel wrote:

> When reading u-boot's key=value pairs it should skip the '=' and not
> use the next argument.

> Signed-off-by: Alban Bedel <albeu@free.fr>
> ---
> arch/mips/fw/lib/cmdline.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/arch/mips/fw/lib/cmdline.c b/arch/mips/fw/lib/cmdline.c
> index ffd0345..cc5d168 100644
> --- a/arch/mips/fw/lib/cmdline.c
> +++ b/arch/mips/fw/lib/cmdline.c
> @@ -68,7 +68,7 @@ char *fw_getenv(char *envname)
> result = fw_envp(index + 1);
> break;
> } else if (fw_envp(index)[i] == '=') {
> - result = (fw_envp(index + 1) + i);
> + result = (fw_envp(index) + i + 1);

Perhaps it's time to drop the useless outer parens?

WBR, Sergei