Dear 庄秋彬,

In message <CAHaqGhZq+qLNNUbS1UnPjQDYepf=auqkdluez0g+b0kynng...@mail.gmail.com> 
you wrote:
>
> I try to use uboot envtools in allwinner's platform, then found that the
> env in allwinner's SDK have some leading zero, that prevent envtools to
> parse it. Finally I add these code to fix it.

This is the wrong approach.

Either you misunderstand the format (for example in case of a
redundant environment where you have to take the flag byte into
consideration), or there is a bug in the implementation of the
Allwinner SDK if it creates such a an environment.

In any case, it is not legal for the U-Boot environment to have any
leading zeros.  By definition, a sequence of two NUL-Bytes will mark
the end of the environment.

You should fix the cause of the problem, and not modify the code to
work on random / incorrect data.

Naked-by: Wolfgang Denk <w...@denx.de>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Anyone can count the seeds in an apple.
No one can count the apples in a seed.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to