Skip to content

Commit c15ed77

Browse files
Simplify String::concat(char)
Now concat(const char*, unsigned int) no longer requires a nul-terminated string, we can simplify the concat(char) method to just pass the address of the single character instead of having to create buffer with nul-termination.
1 parent 41e5586 commit c15ed77

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

hardware/arduino/avr/cores/arduino/WString.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,7 @@ unsigned char String::concat(const char *cstr)
279279

280280
unsigned char String::concat(char c)
281281
{
282-
char buf[2];
283-
buf[0] = c;
284-
buf[1] = 0;
285-
return concat(buf, 1);
282+
return concat(&c, 1);
286283
}
287284

288285
unsigned char String::concat(unsigned char num)

0 commit comments

Comments
 (0)