[PATCH 2/5] scripts: kwboot: allow piping full buffer size at once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While buf == _buf, their type and sizeof differ. The read syscall should
have the buffer size as argument, but instead got the pointer's size.

This likely doesn't change high-level behavior, because read was called
in a loop, so fix this.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 scripts/kwboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 43b8b8cbcdc6..60e8a69d187d 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -504,7 +504,7 @@ kwboot_term_pipe(int in, int out, char *quit, int *s)
 	ssize_t nin, nout;
 	char _buf[128], *buf = _buf;
 
-	nin = read(in, buf, sizeof(buf));
+	nin = read(in, _buf, sizeof(_buf));
 	if (nin < 0)
 		return -1;
 
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux