diff options
author | Karl Ramm <kcr@mit.edu> | 2007-12-25 00:56:08 +0000 |
---|---|---|
committer | Karl Ramm <kcr@mit.edu> | 2007-12-25 00:56:08 +0000 |
commit | 1a0e03eb19998ab496a6ea845ff2c42d9a02df0b (patch) | |
tree | 29b47c8532e1f1678063fbb1b851ee4208134626 /lib/ZParseNot.c | |
parent | 3f120f880be9ae9aa1612ddc2412e9acb9a8e85e (diff) |
applied athena-update-branch patch
Diffstat (limited to 'lib/ZParseNot.c')
-rw-r--r-- | lib/ZParseNot.c | 21 |
1 files changed, 16 insertions, 5 deletions
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; |