From: Chanwoo Choi Date: Thu, 4 Aug 2022 02:27:55 +0000 (+0900) Subject: pass-hal: rpi: Replace LF with space from buffer X-Git-Tag: submit/tizen/20220805.011353^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_8.0_unified;p=platform%2Fadaptation%2Frpi%2Fpass-hal-rpi.git pass-hal: rpi: Replace LF with space from buffer Change-Id: I007af41740cde0f6d1af358a17665af4437ce25d Signed-off-by: Chanwoo Choi --- diff --git a/src/sysfs.c b/src/sysfs.c index 1256076..f6b6d8f 100644 --- a/src/sysfs.c +++ b/src/sysfs.c @@ -41,6 +41,8 @@ static int sysfs_read_buf(char *path, char *buf, int len) if ((r < 0) || (r > len)) return -EIO; + /* Replace '\n' with space (ascii code is 32) */ + buf[strcspn(buf, "\n")] = (char)32; buf[r] = '\0'; return 0;