From: Jochen Eisinger Date: Sun, 1 Dec 2002 15:34:07 +0000 (+0000) Subject: Sun Dec 1 16:32:03 CET 2002 Jochen Eisinger X-Git-Tag: silc.client.0.9.10~43 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=7c811e0c21cf8b71e5df0fdfa9313a14f18aac23;p=silc.git Sun Dec 1 16:32:03 CET 2002 Jochen Eisinger * Format CMODE +c and +h to display both the mode and the argument --- diff --git a/CHANGES b/CHANGES index 1c1b0eea..314b44dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +Sun Dec 1 16:32:03 CET 2002 Jochen Eisinger + + * Format CMODE +c and +h to display both the mode and the argument + Sun Dec 1 18:17:22 EET 2002 Pekka Riikonen * Added test vectors and test programs for SHA-1, MD5, diff --git a/lib/silcutil/silcutil.c b/lib/silcutil/silcutil.c index 7898a4c9..8c906489 100644 --- a/lib/silcutil/silcutil.c +++ b/lib/silcutil/silcutil.c @@ -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 */