Skip to content

Commit 399d9c5

Browse files
committed
Revert "Added function on WString class to export char ptr"
This reverts commit a0c96bebddac27e8ea51811a74d6cdfa2d8a30e0.
1 parent cc8291e commit 399d9c5

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

cores/arduino/Print.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ size_t Print::print(const __FlashStringHelper *ifsh)
5353

5454
size_t Print::print(const String &s)
5555
{
56-
write((const uint8_t*)s.c_str(), s.length());
57-
return s.length();
56+
size_t n = 0;
57+
for (uint16_t i = 0; i < s.length(); i++) {
58+
n += write(s[i]);
59+
}
60+
return n;
5861
}
5962

6063
size_t Print::print(const char str[])

cores/arduino/WString.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,4 @@ long String::toInt(void) const
642642
return 0;
643643
}
644644

645-
char* String::c_str() const
646-
{
647-
return buffer;
648-
}
649645

cores/arduino/WString.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ class String
169169

170170
// parsing/conversion
171171
long toInt(void) const;
172-
char* c_str() const;
173172

174173
protected:
175174
char *buffer; // the actual char array

0 commit comments

Comments
 (0)