summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2009-07-13 05:48:25 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2009-07-13 05:48:25 +0000
commite45b68bc34c737af3002555981e6d07ec4b00f8a (patch)
tree2d8ef57ea335b46d2ec61f6992eb71e670baa658 /lib
parente27458bff5e8526b7e37c729d88990f7a07eb46d (diff)
if we're reencoding a packet, don't blindly claim to have Z_NUMFIELDS
Diffstat (limited to 'lib')
-rw-r--r--lib/Zinternal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Zinternal.c b/lib/Zinternal.c
index ef10ce7..cd29e59 100644
--- a/lib/Zinternal.c
+++ b/lib/Zinternal.c
@@ -869,7 +869,7 @@ Z_ZcodeFormatRawHeader(ZNotice_t *notice,
return (ZERR_HEADERLEN);
if (ZMakeAscii32(ptr, end-ptr,
- Z_NUMFIELDS + notice->z_num_other_fields)
+ (notice->z_num_hdr_fields ? (notice->z_num_hdr_fields - notice->z_num_other_fields) : Z_NUMFIELDS) + notice->z_num_other_fields)
== ZERR_FIELDLEN)
return (ZERR_HEADERLEN);
ptr += strlen(ptr)+1;