Skip to content

Commit e3f227f

Browse files
facchinmcalvinatintel
authored andcommitted
WStrings: add c_str function
this fixes SD library compilation However, in the long term, WString, Print, IPAddress, Stream and WMath (every core file non hardware-related) should be aligned to AVR version to avoid incompatibilities with derived classes
1 parent fd8b3e5 commit e3f227f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cores/arduino/WString.h

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ class String
151151
void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index=0) const;
152152
void toCharArray(char *buf, unsigned int bufsize, unsigned int index=0) const
153153
{getBytes((unsigned char *)buf, bufsize, index);}
154+
const char * c_str() const { return buffer; }
154155

155156
// search
156157
int indexOf( char ch ) const;

0 commit comments

Comments
 (0)