Skip to content

Commit 2c637ce

Browse files
committedAug 31, 2015
Make ClientInterface::statenames consistent with the state enum again
Fixes minetest.get_player_information segfault due to out of bounds access problems, when compiled as debug build.
1 parent 9c44aac commit 2c637ce

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

Diff for: ‎src/clientiface.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ const char *ClientInterface::statenames[] = {
3838
"Disconnecting",
3939
"Denied",
4040
"Created",
41-
"InitSent",
41+
"AwaitingInit2",
42+
"HelloSent",
4243
"InitDone",
4344
"DefinitionsSent",
44-
"Active"
45+
"Active",
46+
"SudoMode",
4547
};
4648

4749

Diff for: ‎src/clientiface.h

+3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ namespace con {
167167

168168
#define CI_ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))
169169

170+
// Also make sure to update the ClientInterface::statenames
171+
// array when modifying these enums
172+
170173
enum ClientState
171174
{
172175
CS_Invalid,

0 commit comments

Comments
 (0)
Please sign in to comment.