[Pkg-privacy-commits] [irssi-plugin-otr] 131/267: Fix: Wrong argument index on otr auth

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.

commit 92b7b2232244d59425b125831f980c9551a5e255
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Wed Nov 14 15:57:16 2012 -0500

    Fix: Wrong argument index on otr auth
    
    Also, remove useless argument explode and question check.
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/cmd.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/cmd.c b/src/cmd.c
index 045c42b..8951bd0 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -146,16 +146,13 @@ static void _cmd_genkey(struct otr_user_state *ustate, SERVER_REC *irssi,
 static void _cmd_authq(struct otr_user_state *ustate, SERVER_REC *irssi,
 		const char *target, const void *data)
 {
-	int argc, ret;
-	char **argv, *question = NULL, *secret = NULL;
-
-	utils_explode_args(data, &argv, &argc);
-
-	if (argc == 0) {
-		IRSSI_NOTICE(irssi, target, "Huh... I need a question here Bob.");
-		goto end;
-	}
+	int ret;
+	char *question = NULL, *secret = NULL;
 
+	/*
+	 * Returns a negative value if the command arguments are not formatted
+	 * correctly or missing. Note, an empty question or secret is valid.
+	 */
 	ret = utils_io_extract_smp(data, &question, &secret);
 	if (ret < 0) {
 		IRSSI_NOTICE(irssi, target, "Usage: %9/otr authq [QUESTION] "
@@ -166,7 +163,6 @@ static void _cmd_authq(struct otr_user_state *ustate, SERVER_REC *irssi,
 	otr_auth(irssi, target, question, secret);
 
 end:
-	utils_free_args(&argv, argc);
 	return;
 }
 
@@ -186,7 +182,7 @@ static void _cmd_auth(struct otr_user_state *ustate, SERVER_REC *irssi,
 		goto end;
 	}
 
-	otr_auth(irssi, target, NULL, argv[1]);
+	otr_auth(irssi, target, NULL, argv[0]);
 
 end:
 	utils_free_args(&argv, argc);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git



More information about the Pkg-privacy-commits mailing list