DFU: Accept redundant spaces and tabs in dfu_alt_info
authorMasami Hiramatsu <masami.hiramatsu@linaro.org>
Mon, 31 Jan 2022 02:52:29 +0000 (11:52 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 11 Feb 2022 16:29:23 +0000 (11:29 -0500)
commit8db74c153b4e30edc5290da6c7330c63558678d0
treee98f5ce256899d325e30abf32939a0d5ac8cc72c
parentd8ae90a8d47da2f22041bf9f6fd6d42a598f44ee
DFU: Accept redundant spaces and tabs in dfu_alt_info

If dfu_alt_info has repeated spaces or tab (for indentation or
readability), the dfu fails to parse it. For example, if
dfu_alt_info="mtd nor1=image raw  100000 200000" (double spaces
after "raw"), the image entity start address is '0' and the size
'0x100000'. This is because the repeated space is not skipped.

Use space and tab as a separater and apply skip_spaces() to
skip redundant spaces and tabs.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
drivers/dfu/dfu.c
drivers/dfu/dfu_mmc.c
drivers/dfu/dfu_mtd.c
drivers/dfu/dfu_nand.c
drivers/dfu/dfu_ram.c
drivers/dfu/dfu_sf.c