/soc/2013/ankitkv/gobjectification: 0201d9d091ab: Fixed silly om...

Ankit Vani a at nevitus.org
Fri Sep 20 14:00:57 EDT 2013


Changeset: 0201d9d091abfa6c4dbfc495bb3e9122f29bd7aa
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-20 23:28 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/0201d9d091ab

Description:

Fixed silly omissions in caesarcipher

diffstat:

 libpurple/plugins/caesarcipher.c          |  6 ++++--
 libpurple/plugins/caesarcipher_consumer.c |  2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff --git a/libpurple/plugins/caesarcipher.c b/libpurple/plugins/caesarcipher.c
--- a/libpurple/plugins/caesarcipher.c
+++ b/libpurple/plugins/caesarcipher.c
@@ -49,9 +49,11 @@ caesar_shift(const guchar input[], size_
 
 	for (i = 0; i < in_len; ++i) {
 		if (input[i] >= 'a' && input[i] <= 'z')
-			output[i] = (((input[i] - 'a') + offset) % 26) + 'a';
+			output[i] = (((input[i] - 'a') + offset + 26) % 26) + 'a';
 		else if (input[i] >= 'A' && input[i] <= 'Z')
-			output[i] = (((input[i] - 'A') + offset) % 26) + 'A';
+			output[i] = (((input[i] - 'A') + offset + 26) % 26) + 'A';
+		else
+			output[i] = input[i];
 	}
 
 	output[i] = '\0';
diff --git a/libpurple/plugins/caesarcipher_consumer.c b/libpurple/plugins/caesarcipher_consumer.c
--- a/libpurple/plugins/caesarcipher_consumer.c
+++ b/libpurple/plugins/caesarcipher_consumer.c
@@ -27,7 +27,7 @@
 #include "caesarcipher.h"
 
 static void
-debug_cipher(PurpleCipher *cipher, const gchar input[])
+debug_cipher(PurpleCipher *cipher, const gchar *input)
 {
 	gchar ciphertext[512], plaintext[512];
 



More information about the Commits mailing list