--- libaitrpc/src/cli.c 2012/03/14 13:29:11 1.6.2.2 +++ libaitrpc/src/cli.c 2012/03/15 00:44:24 1.6.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: cli.c,v 1.6.2.2 2012/03/14 13:29:11 misho Exp $ +* $Id: cli.c,v 1.6.2.3 2012/03/15 00:44:24 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -304,7 +304,7 @@ rpc_cli_execCall(rpc_cli_t *cli, const char *csModule, struct tagRPCCall *rpc; int ret = 0, wlen = sizeof(struct tagRPCCall); struct timeval tv = { DEF_RPC_TIMEOUT, 0 }; - uint16_t tag, crc; + uint16_t tag; uint32_t hash; if (!cli || !csFunc) { @@ -351,7 +351,7 @@ rpc_cli_execCall(rpc_cli_t *cli, const char *csModule, /* calculate CRC */ rpc->call_crc ^= rpc->call_crc; - rpc->call_crc = htons(crcFletcher16((u_short*) buf, ((wlen + 1) & ~1) / 2)); + rpc->call_crc = htons(crcFletcher16((u_short*) buf, io_align(wlen, 1) / 2)); if ((ret = send(cli->cli_sock, buf, wlen, 0)) == -1) { LOGERR;