]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blobdiff - zephyr/lib/ZParseNot.c
krb5-interrealm patches
[1ts-debian.git] / zephyr / lib / ZParseNot.c
index 89b3f67820372344a2db6f3ddb68aa7fc90c03ab..8cdc05155000a2aec989c14f516fe6924b8f2fba 100644 (file)
@@ -209,11 +209,26 @@ Code_t ZParseNotice(buffer, len, notice)
     else
        notice->z_default_format = "";
        
-    if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
-       BAD_PACKET;
-    notice->z_checksum = temp;
-    numfields--;
-    ptr = next_field(ptr, end);
+    if (numfields && ptr < end) {
+      notice->z_ascii_checksum = ptr;
+
+#ifdef xZCODE_K4SUM 
+      if (ZReadZcode32(ptr, end-ptr, &temp) == ZERR_BADFIELD) 
+#else
+      if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
+#endif
+       notice->z_checksum = 0;
+      else
+       notice->z_checksum = temp;
+
+      numfields--;
+      ptr = next_field (ptr, end);
+    }
+    else 
+      {
+       notice->z_ascii_checksum = "";
+       notice->z_checksum = 0;
+      }
 
     if (numfields && ptr < end) {
        notice->z_multinotice = ptr;