Bladeren bron
Merge pull request #343 from FrankBoesing/master
add nullptr check to Print.cpp - write
teensy4-core
Paul Stoffregen
6 jaren geleden
bovenliggende
commit
be57352b60
No account linked to committer's email address
2 gewijzigde bestanden met
toevoegingen van 2 en
0 verwijderingen
-
teensy3/Print.cpp
-
teensy4/Print.cpp
|
|
@@ -39,6 +39,7 @@ |
|
|
|
|
|
|
|
size_t Print::write(const uint8_t *buffer, size_t size) |
|
|
|
{ |
|
|
|
if (buffer == nullptr) return 0; |
|
|
|
size_t count = 0; |
|
|
|
while (size--) count += write(*buffer++); |
|
|
|
return count; |
|
|
@@ -41,6 +41,7 @@ |
|
|
|
|
|
|
|
size_t Print::write(const uint8_t *buffer, size_t size) |
|
|
|
{ |
|
|
|
if (buffer == nullptr) return 0; |
|
|
|
size_t count = 0; |
|
|
|
while (size--) count += write(*buffer++); |
|
|
|
return count; |