From 1a0e03eb19998ab496a6ea845ff2c42d9a02df0b Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Tue, 25 Dec 2007 00:56:08 +0000 Subject: applied athena-update-branch patch --- lib/ZParseNot.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'lib/ZParseNot.c') diff --git a/lib/ZParseNot.c b/lib/ZParseNot.c index 7950e96..a198845 100644 --- a/lib/ZParseNot.c +++ b/lib/ZParseNot.c @@ -209,11 +209,22 @@ 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; + + if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD) + 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; -- cgit v1.2.3