Updated telnet patch
authorSam Hartman <hartmans@mit.edu>
Wed, 27 Mar 2002 02:48:43 +0000 (02:48 +0000)
committerSam Hartman <hartmans@mit.edu>
Wed, 27 Mar 2002 02:48:43 +0000 (02:48 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14295 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/telnet/libtelnet/ChangeLog
src/appl/telnet/libtelnet/kerberos.c
src/appl/telnet/libtelnet/kerberos5.c

index fa3a269ada042addf1e6264ff56f6c72148f3ff3..9014036daaa8de044e6b6f9878f4046efd1287d6 100644 (file)
@@ -1,3 +1,7 @@
+2002-03-26  Sam Hartman  <hartmans@mit.edu>
+
+       * kerberos.c kerberos5.c (Data): Fix indentation; fix termination condition
+
 2002-03-14  Sam Hartman  <hartmans@mit.edu>
 
        * kerberos5.c kerberos.c  (Data): Don't overflow
index 06233ebcd0b014dd9ccd1987ab4d95bb6c894c70..a4970fef1ac13738f3808c9e1e5702b2d487a67f 100644 (file)
@@ -161,15 +161,14 @@ Data(ap, type, d, c)
        *p++ = type;
        spaceleft -= 3;
         while (c-- > 0) {
-if ((*p++ = *cd++) == IAC) {
-*p++ = IAC;
-spaceleft--;
-}
-if (--spaceleft <= 4) {
-errno = ENOMEM;
-return -1;
-}
-
+         if ((*p++ = *cd++) == IAC) {
+           *p++ = IAC;
+           spaceleft--;
+         }
+         if ((--spaceleft < 4)&&c) {
+           errno = ENOMEM;
+           return -1;
+         }
         }
         *p++ = IAC;
         *p++ = SE;
index 8041d1f0c6c146470ed2ac656d37c46c649db239..50c3742fab1a1442e1138a5be0f43b8fbba6a8d2 100644 (file)
@@ -156,15 +156,14 @@ Data(ap, type, d, c)
        *p++ = type;
        spaceleft -= 3;
         while (c-- > 0) {
-if ((*p++ = *cd++) == IAC) {
-*p++ = IAC;
-spaceleft--;
-}
-if (--spaceleft <= 4) {
-errno = ENOMEM;
-return -1;
-}
-
+         if ((*p++ = *cd++) == IAC) {
+           *p++ = IAC;
+           spaceleft--;
+         }
+         if ((--spaceleft < 4)&&c) {
+           errno = ENOMEM;
+           return -1;
+         }
         }
         *p++ = IAC;
         *p++ = SE;