itsanjan / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

write() and print() should return number of bytes written (or indicate that an error occurred). #551

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Print class write(), print(), and println() functions should return an 
number that indicates the number of bytes written, or indicate error.  Probably 
-1 should be used for errors, as there may be situations in which zero bytes 
were written but no error occurred (e.g. print("")).  

Original issue reported on code.google.com by dmel...@gmail.com on 27 May 2011 at 9:07

GoogleCodeExporter commented 9 years ago
I think we want a signed long, so print("") can return 0 and an error can 
return -1.  println() should return two (carriage return and newline).  

Original comment by dmel...@gmail.com on 18 Aug 2011 at 3:39

GoogleCodeExporter commented 9 years ago
https://github.com/arduino/Arduino/commit/8059abe58162faf81cd6d1312915d735116fb8
44

Original comment by dmel...@gmail.com on 23 Aug 2011 at 11:14