Skip to content

Commit a0833a9

Browse files
committed
Fix memory error in broadcast message generation
Thanks to Sebastien Chevalier (ptitSeb).
1 parent 77885a0 commit a0833a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/broadcast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ SDL_Surface *makeBroadcast(char *msg, SDL_Color pcolors[MAX_PLAYERS])
6868
strings[0] = strtok(msg, ";");
6969
for (i = 1; (strings[i] = strtok(NULL, ";")) != NULL; ++i) {}
7070

71-
for (i = 0; strings[i] != NULL && i < BROADC_PARTS; ++i) {
71+
for (i = 0; i < BROADC_PARTS && strings[i] != NULL; ++i) {
7272

7373
char pstring[PLAYER_NAME_LEN];
7474
if (strlen(strings[i]) == 1) {

0 commit comments

Comments
 (0)