* sys_term.c (addarg): Cast char to long in indexing array
authorEzra Peisach <epeisach@mit.edu>
Fri, 6 Jul 2001 15:51:22 +0000 (15:51 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 6 Jul 2001 15:51:22 +0000 (15:51 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13570 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/telnet/telnetd/ChangeLog
src/appl/telnet/telnetd/sys_term.c

index 5a3de7537f1e873e11f7eddf429f100ecba4e787..abbf6df65c788c7513ae319097b8d68dc99732dd 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-06  Ezra Peisach  <epeisach@mit.edu>
+
+       * sys_term.c (addarg): Cast char to long in indexing array.
+
 2001-07-01  Ezra Peisach  <epeisach@mit.edu>
 
        * state.c: Declate doclientstat() static and conditionalize
index 7905a29fba4eec1559c29e124175071dbd270d81..16c66e4ca8c297291d03f44db64c15d6501a30f7 100644 (file)
@@ -1409,6 +1409,12 @@ start_login(host, autologin, name)
        /*NOTREACHED*/
 }
 
+/*
+ * This code returns a pointer to the first element of the array and
+ * expects the same to be called with.
+ * Therefore the -1 reference is legal. 
+ */
+
 static char **
 addarg(argv, val)
        register char **argv;
@@ -1428,14 +1434,14 @@ addarg(argv, val)
        }
        for (cpp = argv; *cpp; cpp++)
                ;
-       if (cpp == &argv[(int)argv[-1]]) {
+       if (cpp == &argv[(long)argv[-1]]) {
                --argv;
-               *argv = (char *)((int)(*argv) + 10);
-               argv = (char **)realloc(argv, (int)(*argv) + 2);
+               *argv = (char *)((long)(*argv) + 10);
+               argv = (char **)realloc(argv, (long)(*argv) + 2);
                if (argv == NULL)
                        return(NULL);
                argv++;
-               cpp = &argv[(int)argv[-1] - 10];
+               cpp = &argv[(long)argv[-1] - 10];
        }
        *cpp++ = val;
        *cpp = 0;