lib: Fix signed/unsigned comparisons
authorVolker Lendecke <vl@samba.org>
Wed, 3 Dec 2014 14:54:19 +0000 (15:54 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 5 Dec 2014 17:37:10 +0000 (18:37 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/data_blob.c
lib/util/util.c

index 1b0e6ab35af8139c0b9b65a08df1a58104c9c02d..4723669858cc4c3edb0498da8cfb74ba0d4c94f4 100644 (file)
@@ -135,7 +135,7 @@ print the data_blob as hex string
 **/
 _PUBLIC_ char *data_blob_hex_string_lower(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob)
 {
-       int i;
+       size_t i;
        char *hex_string;
 
        hex_string = talloc_array(mem_ctx, char, (blob->length*2)+1);
@@ -155,7 +155,7 @@ _PUBLIC_ char *data_blob_hex_string_lower(TALLOC_CTX *mem_ctx, const DATA_BLOB *
 
 _PUBLIC_ char *data_blob_hex_string_upper(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob)
 {
-       int i;
+       size_t i;
        char *hex_string;
 
        hex_string = talloc_array(mem_ctx, char, (blob->length*2)+1);
index 157a4aa9f29aaf5d37bc7c0e6e61822222866b75..562f7df2d54876ddd9961cff84d5d194747b5e58 100644 (file)
@@ -732,7 +732,7 @@ _PUBLIC_ void dump_data_pw(const char *msg, const uint8_t * data, size_t len)
  */
 _PUBLIC_ bool all_zero(const uint8_t *ptr, size_t size)
 {
-       int i;
+       size_t i;
        if (!ptr) return true;
        for (i=0;i<size;i++) {
                if (ptr[i]) return false;