From fd77ad7fc0f3507ba6f8edc5edc0d62e0484032f Mon Sep 17 00:00:00 2001 From: Tiiffi Date: Tue, 3 Dec 2024 05:40:45 +0200 Subject: [PATCH] packet_build(): add [static 1] to generate warning if NULL pointer is passed --- mcrcon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcrcon.c b/mcrcon.c index 37d307b..280d534 100644 --- a/mcrcon.c +++ b/mcrcon.c @@ -90,7 +90,7 @@ int run_terminal_mode(int sock); int run_commands(int argc, char *argv[]); // Rcon protocol related functions -rc_packet* packet_build(int id, int cmd, char *s1); +rc_packet* packet_build(int id, int cmd, char s[static 1]); void packet_print(rc_packet *packet); bool rcon_auth(int sock, char *passwd); int rcon_command(int sock, char *command); @@ -529,7 +529,7 @@ void packet_print(rc_packet *packet) } } -rc_packet *packet_build(int id, int cmd, char *s) +rc_packet *packet_build(int id, int cmd, char s[static 1]) { static rc_packet packet = {0};