summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/playerhandler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 5e847f88f..446766b56 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -157,7 +157,11 @@ static const char *randomDeathMessage()
N_("You're pining for the fjords.")
};
- const int random = static_cast<int>(rand() % (sizeof(deadMsg)
+ const int sz = sizeof(deadMsg);
+ if (!sz)
+ return gettext(deadMsg[0]);
+
+ const int random = static_cast<int>(rand() % (sz
/ sizeof(deadMsg[0])));
return gettext(deadMsg[random]);
}