Skip to content

Commit cb8ea60

Browse files
Fix warning related to sizeof() on const char array, the null terminator is not used here so reworked the array to explicitly be 4 elements
1 parent 005212b commit cb8ea60

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

NetworkProtocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/*-----------------------------------------------------*\
1616
| OpenRGB SDK Magic Value "ORGB" |
1717
\*-----------------------------------------------------*/
18-
const char * openrgb_sdk_magic = "ORGB";
18+
const char openrgb_sdk_magic[OPENRGB_SDK_MAGIC_SIZE] = { 'O', 'R', 'G', 'B' };
1919

2020
void InitNetPacketHeader
2121
(

NetworkProtocol.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
/*-----------------------------------------------------*\
3737
| OpenRGB SDK Magic Value "ORGB" |
3838
\*-----------------------------------------------------*/
39-
extern const char * openrgb_sdk_magic;
39+
#define OPENRGB_SDK_MAGIC_SIZE 4
40+
extern const char openrgb_sdk_magic[OPENRGB_SDK_MAGIC_SIZE];
4041

4142
typedef struct NetPacketHeader
4243
{

0 commit comments

Comments
 (0)