---
main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
index ba652c7..bd9b39b 100644
--- a/main.c
+++ b/main.c
@@ -681,8 +681,8 @@ discussion(size_t pid, char *input)
}
}
- if(vote < -1 || vote > NUM_PLAYERS-1 || players[vote].fd == -1
- || players[vote].stage != PLAYER_STAGE_DISCUSS) {
+ if(vote != -1 && (vote < -1 || vote > NUM_PLAYERS-1 || players[vote].fd == -1
+ || players[vote].stage != PLAYER_STAGE_DISCUSS)) {
snprintf(buf, sizeof(buf), "Invalid vote, no such player\n");
write(players[pid].fd, buf, strlen(buf));
return;
--
2.29.2
Thanks!
To git@git.sr.ht:~martijnbraam/among-sus
f9cf6fa..4aeebd4 master -> master
Made a few style fixes, you'll need to rebase