Browse Source

Merge pull request #343 from FrankBoesing/master

add nullptr check to Print.cpp - write
teensy4-core
Paul Stoffregen 6 years ago
parent
commit
be57352b60
No account linked to committer's email address
2 changed files with 2 additions and 0 deletions
  1. +1
    -0
      teensy3/Print.cpp
  2. +1
    -0
      teensy4/Print.cpp

+ 1
- 0
teensy3/Print.cpp View File



size_t Print::write(const uint8_t *buffer, size_t size) size_t Print::write(const uint8_t *buffer, size_t size)
{ {
if (buffer == nullptr) return 0;
size_t count = 0; size_t count = 0;
while (size--) count += write(*buffer++); while (size--) count += write(*buffer++);
return count; return count;

+ 1
- 0
teensy4/Print.cpp View File



size_t Print::write(const uint8_t *buffer, size_t size) size_t Print::write(const uint8_t *buffer, size_t size)
{ {
if (buffer == nullptr) return 0;
size_t count = 0; size_t count = 0;
while (size--) count += write(*buffer++); while (size--) count += write(*buffer++);
return count; return count;

Loading…
Cancel
Save