Skip to content

Commit 0e89043

Browse files
Chris--Acmaglie
authored andcommitted
Modified begin() & end() for read/write
begin() and end() only allowed read access, these changes now allow both.
1 parent f68a722 commit 0e89043

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hardware/arduino/sam/cores/arduino/WString.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ class String
161161
void toCharArray(char *buf, unsigned int bufsize, unsigned int index=0) const
162162
{getBytes((unsigned char *)buf, bufsize, index);}
163163
const char * c_str() const { return buffer; }
164-
const char* begin() { return c_str(); }
165-
const char* end() { return c_str() + length(); }
164+
char* begin() { return buffer; }
165+
char* end() { return buffer + length(); }
166+
const char* begin() const { return c_str(); }
167+
const char* end() const { return c_str() + length(); }
166168

167169
// search
168170
int indexOf( char ch ) const;

0 commit comments

Comments
 (0)