From: Adrian Szyndela Date: Fri, 23 Jul 2021 11:39:20 +0000 (+0200) Subject: uart: allow whitespace in config X-Git-Tag: submit/tizen/20210805.103313^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2b9c614b070ed27828498a191cbf3486ac2f741;p=platform%2Fcore%2Fapi%2Fperipheral-io.git uart: allow whitespace in config Add spaces to the format string on the sides of the '=' char, to allow any amount of whitespace, including none. For example, all below lines are valid now: 17=/dev/ttyS0 17 =/dev/ttyS0 17= /dev/ttyS0 17 = /dev/ttyS0 17 = /dev/ttyS0 Change-Id: I3369880b89ba865c3b3638f9874788a7eaf60580 --- diff --git a/src/peripheral_uart.c b/src/peripheral_uart.c index ab1dcaa..17644c5 100644 --- a/src/peripheral_uart.c +++ b/src/peripheral_uart.c @@ -79,7 +79,7 @@ static int peripheral_uart_find_devpath(int port, char *buffer, int len) return -1; while (fgets(line, sizeof(line), fp)) { - if (sscanf(line, "%d=%21s", &key, value) != 2) + if (sscanf(line, "%d = %21s", &key, value) != 2) continue; if (key != port)