Sun Dec 1 16:32:03 CET 2002 Jochen Eisinger <c0ffee@penguin-breeder.org>
authorJochen Eisinger <coffee@silcnet.org>
Sun, 1 Dec 2002 15:34:07 +0000 (15:34 +0000)
committerJochen Eisinger <coffee@silcnet.org>
Sun, 1 Dec 2002 15:34:07 +0000 (15:34 +0000)
* Format CMODE +c and +h to display both the mode and the argument

CHANGES
lib/silcutil/silcutil.c

diff --git a/CHANGES b/CHANGES
index 1c1b0eea4968dd258f6e5bb2400808484b1aacb0..314b44dd866204be78f1476c5af8e9800ec8a4eb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+Sun Dec  1 16:32:03 CET 2002  Jochen Eisinger <c0ffee@penguin-breeder.org>
+
+       * Format CMODE +c and +h to display both the mode and the argument
+
 Sun Dec  1 18:17:22 EET 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Added test vectors and test programs for SHA-1, MD5,
index 7898a4c94f7b518f67709d45577dbf0383873339..8c9064891527f6199d346681f9d3a38cf3cb0d53 100644 (file)
@@ -657,15 +657,25 @@ char *silc_client_chmode(SilcUInt32 mode, const char *cipher, const char *hmac)
 
   if (mode & SILC_CHANNEL_MODE_SILENCE_OPERS)
     strncat(string, "M", 1);
+  
+  if (mode & SILC_CHANNEL_MODE_CIPHER)
+    strncat(string, "c", 1);
+  
+  if (mode & SILC_CHANNEL_MODE_HMAC)
+    strncat(string, "h", 1);
 
   if (mode & SILC_CHANNEL_MODE_CIPHER) {
-    if (strlen(cipher) + strlen(string) < sizeof(string))
+    if (strlen(cipher) + strlen(string) + 1< sizeof(string)) {
+      strncat(string, " ", 1);
       strncat(string, cipher, strlen(cipher));
+    }
   }
 
   if (mode & SILC_CHANNEL_MODE_HMAC) {
-    if (strlen(hmac) + strlen(string) < sizeof(string))
+    if (strlen(hmac) + strlen(string) + 1< sizeof(string)) {
+      strncat(string, " ", 1);
       strncat(string, hmac, strlen(hmac));
+    }
   }
 
   /* Rest of mode is ignored */