Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libtelnet fix WARNS=2 warnings



details:   https://anonhg.NetBSD.org/src/rev/05f635db533f
branches:  trunk
changeset: 518434:05f635db533f
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Nov 30 04:44:24 2001 +0000

description:
fix WARNS=2 warnings

diffstat:

 lib/libtelnet/enc_des.c  |  54 ++++++++++++++++++++++++------------------------
 lib/libtelnet/kerberos.c |  12 +++++-----
 2 files changed, 33 insertions(+), 33 deletions(-)

diffs (194 lines):

diff -r 3915796d87de -r 05f635db533f lib/libtelnet/enc_des.c
--- a/lib/libtelnet/enc_des.c   Fri Nov 30 03:01:23 2001 +0000
+++ b/lib/libtelnet/enc_des.c   Fri Nov 30 04:44:24 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: enc_des.c,v 1.5 2001/01/06 23:36:36 christos Exp $     */
+/*     $NetBSD: enc_des.c,v 1.6 2001/11/30 04:44:24 lukem Exp $        */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)enc_des.c  8.3 (Berkeley) 5/30/95"; */
 #else
-__RCSID("$NetBSD: enc_des.c,v 1.5 2001/01/06 23:36:36 christos Exp $");
+__RCSID("$NetBSD: enc_des.c,v 1.6 2001/11/30 04:44:24 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -602,23 +602,23 @@
        int c;
 {
        register struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1];
-       register int index;
+       register int idx;
 
-       index = stp->str_index;
+       idx = stp->str_index;
        while (c-- > 0) {
-               if (index == sizeof(Block)) {
+               if (idx == sizeof(Block)) {
                        Block b;
                        des_ecb_encrypt(&stp->str_output, &b, stp->str_sched, 1);
                        memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
-                       index = 0;
+                       idx = 0;
                }
 
                /* On encryption, we store (feed ^ data) which is cypher */
-               *s = stp->str_output[index] = (stp->str_feed[index] ^ *s);
+               *s = stp->str_output[idx] = (stp->str_feed[idx] ^ *s);
                s++;
-               index++;
+               idx++;
        }
-       stp->str_index = index;
+       stp->str_index = idx;
 }
 
        int
@@ -626,7 +626,7 @@
        int data;
 {
        register struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1];
-       int index;
+       int idx;
 
        if (data == -1) {
                /*
@@ -639,18 +639,18 @@
                return(0);
        }
 
-       index = stp->str_index++;
-       if (index == sizeof(Block)) {
+       idx = stp->str_index++;
+       if (idx == sizeof(Block)) {
                Block b;
                des_ecb_encrypt(&stp->str_output, &b, stp->str_sched, 1);
                memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
                stp->str_index = 1;     /* Next time will be 1 */
-               index = 0;              /* But now use 0 */
+               idx = 0;                /* But now use 0 */
        }
 
        /* On decryption we store (data) which is cypher. */
-       stp->str_output[index] = data;
-       return(data ^ stp->str_feed[index]);
+       stp->str_output[idx] = data;
+       return(data ^ stp->str_feed[idx]);
 }
 
 /*
@@ -678,20 +678,20 @@
        int c;
 {
        register struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1];
-       register int index;
+       register int idx;
 
-       index = stp->str_index;
+       idx = stp->str_index;
        while (c-- > 0) {
-               if (index == sizeof(Block)) {
+               if (idx == sizeof(Block)) {
                        Block b;
                        des_ecb_encrypt(&stp->str_feed, &b, stp->str_sched, 1);
                        memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
-                       index = 0;
+                       idx = 0;
                }
-               *s++ ^= stp->str_feed[index];
-               index++;
+               *s++ ^= stp->str_feed[idx];
+               idx++;
        }
-       stp->str_index = index;
+       stp->str_index = idx;
 }
 
        int
@@ -699,7 +699,7 @@
        int data;
 {
        register struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1];
-       int index;
+       int idx;
 
        if (data == -1) {
                /*
@@ -712,16 +712,16 @@
                return(0);
        }
 
-       index = stp->str_index++;
-       if (index == sizeof(Block)) {
+       idx = stp->str_index++;
+       if (idx == sizeof(Block)) {
                Block b;
                des_ecb_encrypt(&stp->str_feed, &b, stp->str_sched, 1);
                memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
                stp->str_index = 1;     /* Next time will be 1 */
-               index = 0;              /* But now use 0 */
+               idx = 0;                /* But now use 0 */
        }
 
-       return(data ^ stp->str_feed[index]);
+       return(data ^ stp->str_feed[idx]);
 }
 #  endif /* DES_ENCRYPTION */
 # endif        /* AUTHENTICATION */
diff -r 3915796d87de -r 05f635db533f lib/libtelnet/kerberos.c
--- a/lib/libtelnet/kerberos.c  Fri Nov 30 03:01:23 2001 +0000
+++ b/lib/libtelnet/kerberos.c  Fri Nov 30 04:44:24 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kerberos.c,v 1.5 2001/01/06 23:36:37 christos Exp $    */
+/*     $NetBSD: kerberos.c,v 1.6 2001/11/30 04:48:14 lukem Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)kerberos.c 8.3 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: kerberos.c,v 1.5 2001/01/06 23:36:37 christos Exp $");
+__RCSID("$NetBSD: kerberos.c,v 1.6 2001/11/30 04:48:14 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -100,7 +100,6 @@
 
 #define KRB_SERVICE_NAME   "rcmd"
 
-static KTEXT_ST auth;
 static char name[ANAME_SZ];
 static AUTH_DAT adat = { 0 };
 #ifdef ENCRYPTION
@@ -267,6 +266,7 @@
        Session_Key skey;
        Block datablock;
 #endif /* ENCRYPTION */
+       KTEXT_ST auth;
        char realm[REALM_SZ];
        char instance[INST_SZ];
        int r;
@@ -436,16 +436,16 @@
 }
 
        int
-kerberos4_status(ap, name, level)
+kerberos4_status(ap, kname, level)
        Authenticator *ap;
-       char *name;
+       char *kname;
        int level;
 {
        if (level < AUTH_USER)
                return(level);
 
        if (UserNameRequested && !kuserok(&adat, UserNameRequested)) {
-               strcpy(name, UserNameRequested);
+               strcpy(kname, UserNameRequested);
                return(AUTH_VALID);
        } else
                return(AUTH_USER);



Home | Main Index | Thread Index | Old Index