[Pkg-privacy-commits] [irssi-plugin-otr] 102/267: Fix: strcmp to strncmp and disable io_set unused code
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:22 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 d265297bfa99fabb729cdcb7af464c6ee29c651e
Author: David Goulet <dgoulet at ev0ke.net>
Date: Sat Nov 3 18:31:45 2012 -0400
Fix: strcmp to strncmp and disable io_set unused code
Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
src/cmd.c | 2 +-
src/io_set.c | 3 ++-
src/key.c | 2 +-
src/otr.c | 10 +++++-----
4 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/cmd.c b/src/cmd.c
index c198075..648182e 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -101,7 +101,7 @@ static void _cmd_genkey(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *arg
char *argv_eol[], char *target)
{
if (argc) {
- if (strcmp(argv[0], "abort") == 0) {
+ if (strncmp(argv[0], "abort", strlen("abort")) == 0) {
key_generation_abort(ioustate, FALSE);
} else if (strchr(argv[0], '@')) {
key_generation_run(ioustate, argv[0]);
diff --git a/src/io_set.c b/src/io_set.c
index 477faa3..b0a1a01 100644
--- a/src/io_set.c
+++ b/src/io_set.c
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
*/
-
+#if 0
#include "otr.h"
#ifdef HAVE_GREGEX_H
@@ -60,3 +60,4 @@ void cmd_set(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *
set_finishonunload = (strcasecmp(value,"true")==0);
}
}
+#endif
diff --git a/src/key.c b/src/key.c
index 1fe0b2a..acb4334 100644
--- a/src/key.c
+++ b/src/key.c
@@ -144,7 +144,7 @@ void key_generation_run(IOUSTATE *ioustate, const char *accname)
char *dir = dirname(filenamedup);
if (kg_st.status != KEYGEN_NO) {
- if (strcmp(accname, kg_st.accountname) != 0) {
+ if (strncmp(accname, kg_st.accountname, strlen(accname)) != 0) {
otr_noticest(TXT_KG_ABORTED_DUP, accname, kg_st.accountname);
}
g_free(filenamedup);
diff --git a/src/otr.c b/src/otr.c
index a55f276..720eb6a 100644
--- a/src/otr.c
+++ b/src/otr.c
@@ -252,7 +252,7 @@ struct ctxlist_ *otr_contexts(IOUSTATE *ioustate)
fplist->fp = g_strdup(fp);
if (*trust == '\0') {
fplist->authby = NOAUTH;
- } else if (strcmp(trust, "smp") == 0) {
+ } else if (strncmp(trust, "smp", strlen("smp")) == 0) {
fplist->authby = AUTHSMP;
} else {
fplist->authby = AUTHMAN;
@@ -310,8 +310,8 @@ int otr_getstatus(IRC_CTX *ircctx, const char *nick)
}
if (trust && (*trust != '\0'))
- code |= strcmp(trust, "smp") == 0 ? IO_ST_TRUST_SMP :
- IO_ST_TRUST_MANUAL;
+ code |= strncmp(trust, "smp", strlen("cmp")) == 0 ?
+ IO_ST_TRUST_SMP : IO_ST_TRUST_MANUAL;
else
code |= IO_ST_UNTRUSTED;
@@ -685,8 +685,8 @@ int otr_receive(IRC_CTX *ircctx, const char *msg, const char *from,
/* Really lame but I don't see how you could do this in a generic
* way unless the IRC server would somehow mark continuation messages.
*/
- if ((strcmp(msg, coi->better_msg_two) == 0) ||
- (strcmp(msg, formats[TXT_OTR_BETTER_THREE].def) == 0)) {
+ if ((strncmp(msg, coi->better_msg_two, strlen(msg)) == 0) ||
+ (strncmp(msg, formats[TXT_OTR_BETTER_THREE].def, strlen(msg)) == 0)) {
otr_debug(ircctx, from, TXT_RECEIVE_IGNORE_QUERY);
goto error;
}
--
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