summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-10-01 09:43:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-02 06:30:59 +0200
commitd2cd3238c21c54afbb1b3b79b7061458649dbd17 (patch)
tree4c69ad0f8b1f99ed751cb90a00da4fe49034d784 /scripts
parentcac4e34f2da46798d77907ebcd4c11c770ed0f13 (diff)
downloadbarebox-d2cd3238c21c54afbb1b3b79b7061458649dbd17.tar.gz
barebox-d2cd3238c21c54afbb1b3b79b7061458649dbd17.tar.xz
scripts: kwboot: allow piping full buffer size at once
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@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kwboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 43b8b8cbcd..60e8a69d18 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;