+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
*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;
*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;