ii

git clone https://orangeshoelaces.net/git/ii.git

e1af846735f8a7ff7acfd9ddacb7cfd8e494a998

Author: nion@h4447.serverkompetenz.net on 02/01/2007

Committer: nion@h4447.serverkompetenz.net on 02/01/2007

use TOK_CMD more safely

Stats

ii.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/ii.c b/ii.c
index bc72e97..8ee11c1 100644
--- a/ii.c
+++ b/ii.c
@@ -351,7 +351,7 @@ static void proc_server_cmd(char *buf) {
 	} else if(!strncmp("PART", argv[TOK_CMD], 5)) {
 		snprintf(message, PIPE_BUF, "-!- %s(%s) has left %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_CHAN]);
 	} else if(!strncmp("MODE", argv[TOK_CMD], 5))
-		snprintf(message, PIPE_BUF, "-!- %s changed mode/%s -> %s %s", argv[TOK_NICKSRV], argv[TOK_CMD + 1], argv[TOK_CMD + 2], argv[TOK_CMD + 3]);
+		snprintf(message, PIPE_BUF, "-!- %s changed mode/%s -> %s %s", argv[TOK_NICKSRV], argv[TOK_CMD + 1] ? argv[TOK_CMD + 1] : "" , argv[TOK_CMD + 2]? argv[TOK_CMD + 2] : "", argv[TOK_CMD + 3] ? argv[TOK_CMD + 3] : "");
 	else if(!strncmp("QUIT", argv[TOK_CMD], 5))
 		snprintf(message, PIPE_BUF, "-!- %s(%s) has quit \"%s\"", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
 	else if(!strncmp("NICK", argv[TOK_CMD], 5))