We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06ec575 commit 3700801Copy full SHA for 3700801
src/CheerLights.cpp
@@ -5,8 +5,9 @@
5
#define BUFFER_SIZE 128
6
7
CheerLights::CheerLights() {
8
- strcpy(_colorName, "black");
9
- _colorHex = 0x000000;
+ strncpy(_colorName, "black", sizeof(_colorName) - 1);
+ _colorName[sizeof(_colorName) - 1] = '\0';
10
+ _colorHex = 0x000000;
11
}
12
13
void CheerLights::begin(const char* ssid, const char* password) {
src/CheerLights.h
@@ -41,7 +41,7 @@ class CheerLights {
41
void _fetchColor();
42
const char* _ssid;
43
const char* _password;
44
- const char* _colorName;
+ char _colorName[32];
45
uint32_t _colorHex;
46
};
47
0 commit comments