diff options
Diffstat (limited to 'lib/ZFmtAuth.c')
-rw-r--r-- | lib/ZFmtAuth.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/ZFmtAuth.c b/lib/ZFmtAuth.c index 5d7f91c..71fa5a6 100644 --- a/lib/ZFmtAuth.c +++ b/lib/ZFmtAuth.c @@ -36,18 +36,15 @@ Code_t ZFormatAuthenticNotice(notice, buffer, buffer_len, len, session) newnotice.z_authent_len = 0; newnotice.z_ascii_authent = (char *)""; - if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len, &hdrlen)) - != ZERR_NONE) + if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len, + &hdrlen, &ptr)) != ZERR_NONE) return (retval); - for (hdrlen--;buffer[hdrlen-1];hdrlen--) - ; - - newnotice.z_checksum = (ZChecksum_t)quad_cksum(buffer, NULL, hdrlen, 0, - session); + newnotice.z_checksum = (ZChecksum_t)quad_cksum(buffer, NULL, ptr - buffer, + 0, session); - if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len, &hdrlen)) - != ZERR_NONE) + if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len, + &hdrlen, (char **) 0)) != ZERR_NONE) return (retval); ptr = buffer+hdrlen; |