Skip to content

Commit 6967b75

Browse files
committed
Print not aborting on write failure
See arduino#3614
1 parent 71b122e commit 6967b75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/arduino/Print.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919
Modified 23 November 2006 by David A. Mellis
20+
Modified 03 August 2015 by Chuck Todd
2021
*/
2122

2223
#include <stdlib.h>
@@ -34,7 +35,8 @@ size_t Print::write(const uint8_t *buffer, size_t size)
3435
{
3536
size_t n = 0;
3637
while (size--) {
37-
n += write(*buffer++);
38+
if (write(*buffer++)) n++;
39+
else break;
3840
}
3941
return n;
4042
}

0 commit comments

Comments
 (0)