r3762: - only load the readed bytes into the input buffer
authorStefan Metzmacher <metze@samba.org>
Mon, 15 Nov 2004 17:27:07 +0000 (17:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:05:52 +0000 (13:05 -0500)
- fix compiler warnings with gcc-4.0

metze

source/ldap_server/ldap_server.c

index 9338baa165f8597fc76be44c62676587445fc3d8..9f256b0b8b3af22dacf8f443923d15e84e5b5748 100644 (file)
@@ -173,6 +173,7 @@ static BOOL read_into_buf(struct socket_context *sock, struct rw_buffer *buf)
                talloc_free(tmp_blob.data);
                return False;
        }
+       tmp_blob.length = nread;
 
        ret = ldapsrv_append_to_buf(buf, tmp_blob.data, tmp_blob.length);
 
@@ -188,7 +189,7 @@ static BOOL ldapsrv_read_buf(struct ldapsrv_connection *conn)
        DATA_BLOB creds;
        BOOL ret;
        uint8_t *buf;
-       int buf_length, sasl_length;
+       size_t buf_length, sasl_length;
        struct socket_context *sock = conn->connection->socket;
        TALLOC_CTX *mem_ctx;
        size_t nread;
@@ -445,7 +446,7 @@ static void ldapsrv_recv(struct server_connection *conn, struct timeval t,
 {
        struct ldapsrv_connection *ldap_conn = conn->private_data;
        uint8_t *buf;
-       int buf_length, msg_length;
+       size_t buf_length, msg_length;
        DATA_BLOB blob;
        struct asn1_data data;
        struct ldapsrv_call *call;