From 8e5857c815f12f4d710db2b59945e87dd69e0708 Mon Sep 17 00:00:00 2001
From: Brian Carrier <carrier@sleuthkit.org>
Date: Tue, 28 Apr 2009 15:42:43 +0000
Subject: [PATCH] Resolved some compile warnings in recent fixes

---
 tsk3/fs/fs_attr.c  | 2 +-
 tsk3/fs/hfs.c      | 3 ---
 tsk3/fs/hfs_dent.c | 3 ++-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tsk3/fs/fs_attr.c b/tsk3/fs/fs_attr.c
index 6ced0f2af..e5b443b04 100644
--- a/tsk3/fs/fs_attr.c
+++ b/tsk3/fs/fs_attr.c
@@ -1037,7 +1037,7 @@ tsk_fs_attr_read(const TSK_FS_ATTR * a_fs_attr, TSK_OFF_T a_offset,
         }
 
         if (a_offset + a_len > a_fs_attr->size)
-            read_len = a_fs_attr->size - (size_t) a_offset;
+            read_len = (size_t)(a_fs_attr->size - a_offset);
         else
             read_len = a_len;
 
diff --git a/tsk3/fs/hfs.c b/tsk3/fs/hfs.c
index e27085e1a..845b0586f 100644
--- a/tsk3/fs/hfs.c
+++ b/tsk3/fs/hfs.c
@@ -1679,7 +1679,6 @@ static uint8_t
 hfs_make_badblockfile(HFS_INFO * hfs, TSK_FS_FILE * fs_file)
 {
     TSK_FS_ATTR *fs_attr;
-    TSK_FS_ATTR_RUN *attr_run;
 
     if (tsk_verbose)
         tsk_fprintf(stderr,
@@ -1699,7 +1698,6 @@ hfs_make_badblockfile(HFS_INFO * hfs, TSK_FS_FILE * fs_file)
                 TSK_FS_ATTR_NONRES)) == NULL) {
         strncat(tsk_errstr2, " - hfs_make_attrfile",
             TSK_ERRSTR_L - strlen(tsk_errstr2));
-        tsk_fs_attr_run_free(attr_run);
         return 1;
     }
 
@@ -1710,7 +1708,6 @@ hfs_make_badblockfile(HFS_INFO * hfs, TSK_FS_FILE * fs_file)
         strncat(tsk_errstr2, " - hfs_make_attrfile",
             TSK_ERRSTR_L - strlen(tsk_errstr2));
         tsk_fs_attr_free(fs_attr);
-        tsk_fs_attr_run_free(attr_run);
         return 1;
     }
 
diff --git a/tsk3/fs/hfs_dent.c b/tsk3/fs/hfs_dent.c
index cf3a594a9..48020d973 100644
--- a/tsk3/fs/hfs_dent.c
+++ b/tsk3/fs/hfs_dent.c
@@ -195,6 +195,7 @@ hfs_dir_open_meta_cb(HFS_INFO * hfs, int8_t level_type,
     else {
         uint8_t *rec_buf = (uint8_t *) cur_key;
         uint16_t rec_type;
+        size_t rec_off2;
 
         if (tsk_getu32(hfs->fs_info.endian,
                 cur_key->parent_cnid) < *cnid_p)
@@ -203,7 +204,7 @@ hfs_dir_open_meta_cb(HFS_INFO * hfs, int8_t level_type,
                 cur_key->parent_cnid) > *cnid_p)
             return HFS_BTREE_CB_LEAF_STOP;
 
-        size_t rec_off2 =
+        rec_off2 =
             2 + tsk_getu16(hfs->fs_info.endian, cur_key->key_len);
         // @@@ NEED TO REPLACE THIS SOMEHOW, but need to figure out the max length
         /*
-- 
GitLab