Fixed some compiler warnings
This commit is contained in:
@@ -1805,7 +1805,7 @@ int binkp_send_frame(int cmd, char *buf, int len)
|
||||
#ifdef HAVE_ZLIB_H
|
||||
int rcz, last;
|
||||
uLongf zlen;
|
||||
char *zbuf;
|
||||
Bytef *zbuf;
|
||||
|
||||
if ((len >= BINKP_PLZ_BLOCK) && (bp.PLZwe == Active)) {
|
||||
WriteError("Can't send block of %d bytes in PLZ mode", len);
|
||||
@@ -1841,7 +1841,7 @@ int binkp_send_frame(int cmd, char *buf, int len)
|
||||
if ((bp.PLZwe == Active) && (len > 20) && (!cmd) && (bp.tmode != CompGZ) && (bp.tmode != CompBZ2)) {
|
||||
zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char));
|
||||
zlen = BINKP_PLZ_BLOCK -1;
|
||||
rcz = compress2(zbuf, &zlen, buf, len, 9);
|
||||
rcz = compress2(zbuf, &zlen, (Bytef *)buf, (uLong)len, 9);
|
||||
if (rcz == Z_OK) {
|
||||
Syslog('b', "Binkp: compressed OK, srclen=%d, destlen=%d, will send compressed=%s",
|
||||
len, zlen, (zlen < len) ?"yes":"no");
|
||||
@@ -1867,7 +1867,7 @@ int binkp_send_frame(int cmd, char *buf, int len)
|
||||
if (!rc)
|
||||
rc = PUTCHAR(header & 0x00ff);
|
||||
if (zlen && !rc)
|
||||
rc = PUT(zbuf, zlen);
|
||||
rc = PUT((char *)zbuf, (int)zlen);
|
||||
} else {
|
||||
rc = PUTCHAR((header >> 8) & 0x00ff);
|
||||
if (!rc)
|
||||
@@ -2357,7 +2357,7 @@ int binkp_poll_frame(void)
|
||||
if ((bp.PLZthey == Active) && (bp.header & BINKP_PLZ_BLOCK) && (bp.rmode == CompNone) && bp.blklen) {
|
||||
zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char));
|
||||
zlen = BINKP_PLZ_BLOCK -1;
|
||||
rc = uncompress(zbuf, &zlen, bp.rxbuf, bp.rxlen -1);
|
||||
rc = uncompress((Bytef *)zbuf, &zlen, (Bytef *)bp.rxbuf, bp.rxlen -1);
|
||||
if (rc == Z_OK) {
|
||||
bp.rxcompressed += (zlen - (bp.rxlen -1));
|
||||
memmove(bp.rxbuf, zbuf, zlen);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* Purpose ...............: MD5 for binkp protocol driver
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2004
|
||||
* Copyright (C) 1997-2007
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@@ -514,7 +514,7 @@ char *MD_buildDigest(char *pw, unsigned char *challenge)
|
||||
if ((!pw) || (!challenge))
|
||||
return rs;
|
||||
|
||||
hmac_md5(challenge+1, challenge[0], pw, strlen(pw), digest);
|
||||
hmac_md5(challenge+1, challenge[0], (unsigned char *)pw, strlen(pw), digest);
|
||||
rs = (char *)xmalloc(MD5_DIGEST_LEN * 2 + 10);
|
||||
MD_toString(rs, MD5_DIGEST_LEN, digest);
|
||||
return rs;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Fidonet mailer
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2005
|
||||
* Copyright (C) 1997-2007
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@@ -356,7 +356,7 @@ SM_STATE(recvblk)
|
||||
|
||||
if (crcmode && (header != SYN)) {
|
||||
remotecrc = (short)xmblk.c1 << 8 | xmblk.c2;
|
||||
localcrc = crc16xmodem(xmblk.data, sizeof(xmblk.data));
|
||||
localcrc = crc16xmodem((char *)xmblk.data, sizeof(xmblk.data));
|
||||
if (remotecrc != localcrc) {
|
||||
Syslog('x', "bad crc: 0x%04x/0x%04x",remotecrc,localcrc);
|
||||
if (recv_blk == (ackd_blk+1)) {
|
||||
@@ -367,7 +367,7 @@ SM_STATE(recvblk)
|
||||
}
|
||||
} else {
|
||||
remotecs = xmblk.c1;
|
||||
localcs = checksum(xmblk.data, sizeof(xmblk.data));
|
||||
localcs = checksum((char *)xmblk.data, sizeof(xmblk.data));
|
||||
if (remotecs != localcs) {
|
||||
Syslog('x', "bad checksum: 0x%02x/0x%02x",remotecs,localcs);
|
||||
if (recv_blk == (ackd_blk+1)) {
|
||||
@@ -394,7 +394,7 @@ SM_STATE(recvblk)
|
||||
SM_PROCEED(waitblk);
|
||||
}
|
||||
|
||||
Syslog('X', "received block %ld \"%s\"", recv_blk,printable(xmblk.data,128));
|
||||
Syslog('X', "received block %d \"%s\"", recv_blk,printable((char *)xmblk.data,128));
|
||||
|
||||
if (fp == NULL) {
|
||||
if ((fp = openfile(tmpfname,remtime,remsize,&resofs,resync)) == NULL) {
|
||||
@@ -434,9 +434,9 @@ SM_STATE(recvblk)
|
||||
|
||||
SM_STATE(checktelink)
|
||||
|
||||
Syslog('x', "checktelink got \"%s\"",printable(xmblk.data,45));
|
||||
Syslog('x', "checktelink got \"%s\"",printable((char *)xmblk.data,45));
|
||||
if (tmpfname[0] == '\0') {
|
||||
strncpy(tmpfname,xmblk.data+8,16);
|
||||
strncpy(tmpfname,(char *)xmblk.data+8,16);
|
||||
/*
|
||||
* Some systems fill the rest of the filename with spaces, sigh.
|
||||
*/
|
||||
@@ -447,8 +447,8 @@ SM_STATE(checktelink)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
Syslog('+', "Remote uses %s",printable(xmblk.data+25,-14));
|
||||
Syslog('x', "Remote file name \"%s\" discarded", printable(xmblk.data+8,-16));
|
||||
Syslog('+', "Remote uses %s",printable((char *)xmblk.data+25,-14));
|
||||
Syslog('x', "Remote file name \"%s\" discarded", printable((char *)xmblk.data+8,-16));
|
||||
}
|
||||
remsize = ((off_t)xmblk.data[0]) + ((off_t)xmblk.data[1]<<8) + ((off_t)xmblk.data[2]<<16) + ((off_t)xmblk.data[3]<<24);
|
||||
last_blk = (remsize-1)/XMBLKSIZ+1;
|
||||
|
Reference in New Issue
Block a user