aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-08-29 19:04:53 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2009-08-29 19:04:53 +0200
commit65850a1bad2aefd02b80ac275a5e879200c77ca2 (patch)
treec018e58f3722d7977e0f0a0f7ebc4aa2c6581d4b
parent1137f0d48c9211a7a885d73400c50a8d979b0a66 (diff)
downloadlibssh-65850a1bad2aefd02b80ac275a5e879200c77ca2.tar.gz
libssh-65850a1bad2aefd02b80ac275a5e879200c77ca2.tar.xz
libssh-65850a1bad2aefd02b80ac275a5e879200c77ca2.zip
Fix "void * ptr used in pointer arithmetic" warng
-rw-r--r--libssh/channels1.c6
-rw-r--r--libssh/packet.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/libssh/channels1.c b/libssh/channels1.c
index 611c99b7..914cd386 100644
--- a/libssh/channels1.c
+++ b/libssh/channels1.c
@@ -282,7 +282,7 @@ int channel_write1(ssh_channel channel, const void *data, int len) {
SSH_SESSION *session = channel->session;
int origlen = len;
int effectivelen;
-
+ const unsigned char *ptr=data;
while (len > 0) {
if (buffer_add_u8(session->out_buffer, SSH_CMSG_STDIN_DATA) < 0) {
return -1;
@@ -291,11 +291,11 @@ int channel_write1(ssh_channel channel, const void *data, int len) {
effectivelen = len > 32000 ? 32000 : len;
if (buffer_add_u32(session->out_buffer, htonl(effectivelen)) < 0 ||
- buffer_add_data(session->out_buffer, data, effectivelen) < 0) {
+ buffer_add_data(session->out_buffer, ptr, effectivelen) < 0) {
return -1;
}
- data += effectivelen;
+ ptr += effectivelen;
len -= effectivelen;
if (packet_send(session) != SSH_OK) {
diff --git a/libssh/packet.c b/libssh/packet.c
index 4aadf56e..f0a56b17 100644
--- a/libssh/packet.c
+++ b/libssh/packet.c
@@ -318,7 +318,7 @@ static int packet_read1(SSH_SESSION *session) {
}
memcpy(&crc,
- buffer_get_rest(session->in_buffer) + (len+padding) - sizeof(uint32_t),
+ (unsigned char *)buffer_get_rest(session->in_buffer) + (len+padding) - sizeof(uint32_t),
sizeof(uint32_t));
buffer_pass_bytes_end(session->in_buffer, sizeof(uint32_t));
crc = ntohl(crc);
@@ -544,7 +544,7 @@ static int packet_send1(SSH_SESSION *session) {
goto error;
}
- crc = ssh_crc32(buffer_get(session->out_buffer) + sizeof(uint32_t),
+ crc = ssh_crc32((char *)buffer_get(session->out_buffer) + sizeof(uint32_t),
buffer_get_len(session->out_buffer) - sizeof(uint32_t));
if (buffer_add_u32(session->out_buffer, ntohl(crc)) < 0) {
@@ -556,7 +556,7 @@ static int packet_send1(SSH_SESSION *session) {
buffer_get_len(session->out_buffer));
#endif
- packet_encrypt(session, buffer_get(session->out_buffer) + sizeof(uint32_t),
+ packet_encrypt(session, (unsigned char *)buffer_get(session->out_buffer) + sizeof(uint32_t),
buffer_get_len(session->out_buffer) - sizeof(uint32_t));
#ifdef DEBUG_CRYPTO