On Fri, Aug 23, 2019 at 11:25:31AM +0200, Ahmad Fatoum wrote: > Trying to output a single character via > echo -a /dev/serial0-1 > currently results in garbage output after the newline, because console.c's > fops_write discards the buffer length and passes the buffer to > (struct cdev)::puts which only handles NUL-terminated strings. > > Fix this by amending (struct cdev)::puts with a new nbytes parameter, > which is correctly propagated. All this functions now return at most the > nbytes parameter they were passed in. This fixes __console_puts, which > used to count new lines twice in its return value. > > Fixes: b4f55fcf35 ("console: expose consoles in devfs") > Cc: Bastian Krause <bst@xxxxxxxxxxxxxx> > Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> > --- Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox