libpst

changeset 125:23a36ac0514d

recover dropped pragma pack line, use int64_t rather than off_t to avoid forcing users of the shared library to enable large file support.
author Carl Byington <carl@five-ten-sg.com>
date Tue, 03 Feb 2009 15:01:47 -0800
parents cbf63dd3f109
children f01d6163acba
files ChangeLog regression/regression-tests.bash src/common.h src/debug.c src/libpst.c src/libpst.h src/readpst.c src/readpstlog.c
diffstat 8 files changed, 86 insertions(+), 80 deletions(-) [+]
line diff
     1.1 --- a/ChangeLog	Tue Feb 03 11:00:16 2009 -0800
     1.2 +++ b/ChangeLog	Tue Feb 03 15:01:47 2009 -0800
     1.3 @@ -1,4 +1,4 @@
     1.4 -LibPST 0.6.26 (2009-02-02)
     1.5 +LibPST 0.6.26 (2009-02-03)
     1.6  ===============================
     1.7      * patch from Fridrich Strba for building on mingw and
     1.8        general cleanup of autoconf files
     1.9 @@ -7,8 +7,6 @@
    1.10        libpst.so and the header files required to use it.
    1.11      * remove version.h since the version number is now in config.h
    1.12      * more const correctness issues regarding getopt()
    1.13 -    * disable building pst2dii on cygwin, since the convert program
    1.14 -      on the path is part of windows, not image magic.
    1.15      * consistent ordering of our include files. all system includes
    1.16        protected by ifdef HAVE_ from autoconf.
    1.17      * strip and regenerate all MIME headers to avoid duplicates.
    1.18 @@ -20,7 +18,9 @@
    1.19        HAVE_ symbols. define.h is the only other file allowed to
    1.20        include system .h files. define.h is never installed; common.h
    1.21        is installed if we are building the shared library.
    1.22 -
    1.23 +    * recover dropped pragma pack line, use int64_t rather than off_t
    1.24 +      to avoid forcing users of the shared library to enable large
    1.25 +      file support.
    1.26  
    1.27  LibPST 0.6.25 (2009-01-16)
    1.28  ===============================
     2.1 --- a/regression/regression-tests.bash	Tue Feb 03 11:00:16 2009 -0800
     2.2 +++ b/regression/regression-tests.bash	Tue Feb 03 15:01:47 2009 -0800
     2.3 @@ -23,6 +23,7 @@
     2.4      mkdir output$n
     2.5      #    ../src/readpst -cv -o output$n $fn >$ba.err 2>&1
     2.6      $val ../src/readpst -cv -o output$n -d dumper $fn >$ba.err 2>&1
     2.7 +    #readpst -cv -o output$n -d dumper $fn >$ba.err 2>&1
     2.8           ../src/readpstlog -f I dumper >$ba.log
     2.9      #$val ../src/pst2ldif -d dumper -b 'o=ams-cc.com, c=US' -c 'newPerson' -o $fn >$ba.ldif.err 2>&1
    2.10      #$val ../src/pst2ldif -d dumper -b 'o=ams-cc.com, c=US' -c 'inetOrgPerson' $fn >$ba.ldif2.err 2>&1
    2.11 @@ -33,7 +34,7 @@
    2.12  
    2.13  
    2.14  val="valgrind --leak-check=full"
    2.15 -#val=''
    2.16 +val=''
    2.17  
    2.18  pushd ..
    2.19  make || exit
     3.1 --- a/src/common.h	Tue Feb 03 11:00:16 2009 -0800
     3.2 +++ b/src/common.h	Tue Feb 03 15:01:47 2009 -0800
     3.3 @@ -29,6 +29,7 @@
     3.4  
     3.5  
     3.6  #ifndef _WIN32
     3.7 +    #pragma pack(1)
     3.8      typedef uint32_t  DWORD;
     3.9      typedef uint16_t   WORD;
    3.10      typedef uint8_t    BYTE;
     4.1 --- a/src/debug.c	Tue Feb 03 11:00:16 2009 -0800
     4.2 +++ b/src/debug.c	Tue Feb 03 15:01:47 2009 -0800
     4.3 @@ -48,7 +48,7 @@
     4.4      if (col == -1) col = NUM_COL;
     4.5      fprintf(out, "\n");
     4.6      while (off < size) {
     4.7 -        fprintf(out, "%06"PRIx64"\t:", (uint64_t)(off+delta));
     4.8 +        fprintf(out, "%06"PRIx64"\t:", (int64_t)(off+delta));
     4.9          toff = off;
    4.10          while (count < col && off < size) {
    4.11              fprintf(out, "%02hhx ", (unsigned char)buf[off]);
    4.12 @@ -251,19 +251,19 @@
    4.13      size_t size, ptr, funcname, filename, text, end;
    4.14      char *buf = NULL, rec_type;
    4.15      if (!debug_fp) return;  // no file
    4.16 -    uint64_t index_pos = ftello(debug_fp);
    4.17 -    uint64_t file_pos  = index_pos;
    4.18 +    int64_t index_pos = ftello(debug_fp);
    4.19 +    int64_t file_pos  = index_pos;
    4.20      // add 2. One for the pointer to the next index,
    4.21      // one for the count of this index
    4.22 -    int index_size = ((curr_items+2) * sizeof(uint64_t));
    4.23 -    uint64_t *index;
    4.24 +    int index_size = ((curr_items+2) * sizeof(int64_t));
    4.25 +    int64_t *index;
    4.26      int index_ptr = 0;
    4.27      struct pst_debug_file_rec_m mfile_rec;
    4.28      struct pst_debug_file_rec_l lfile_rec;
    4.29  
    4.30      if (curr_items == 0) return;    // no items to write.
    4.31  
    4.32 -    index = (uint64_t*)xmalloc(index_size);
    4.33 +    index = (int64_t*)xmalloc(index_size);
    4.34      memset(index, 0, index_size);   // valgrind, avoid writing uninitialized data
    4.35      file_pos += index_size;
    4.36      // write the index first, we will re-write it later, but
    4.37 @@ -335,9 +335,9 @@
    4.38      struct pst_debug_file_rec_l lfile_rec;
    4.39      struct pst_debug_file_rec_m mfile_rec;
    4.40      unsigned char rec_type;
    4.41 -    int index_size = 3 * sizeof(uint64_t);
    4.42 -    uint64_t index[3];
    4.43 -    uint64_t index_pos, file_pos;
    4.44 +    int index_size = 3 * sizeof(int64_t);
    4.45 +    int64_t index[3];
    4.46 +    int64_t index_pos, file_pos;
    4.47      char zero = '\0';
    4.48      unsigned int end;
    4.49      if (!debug_fp) return;  // no file
    4.50 @@ -397,8 +397,8 @@
    4.51  void pst_debug_write_hex(struct pst_debug_item *item, char *buf, size_t size, int col) {
    4.52      struct pst_debug_file_rec_l lfile_rec;
    4.53      unsigned char rec_type;
    4.54 -    int index_size = 3 * sizeof(uint64_t);
    4.55 -    uint64_t index_pos, file_pos, index[3];
    4.56 +    int index_size = 3 * sizeof(int64_t);
    4.57 +    int64_t index_pos, file_pos, index[3];
    4.58      char zero='\0';
    4.59      if (!debug_fp) return;  // no file
    4.60      index[0] = 1; // only one item in this index run
     5.1 --- a/src/libpst.c	Tue Feb 03 11:00:16 2009 -0800
     5.2 +++ b/src/libpst.c	Tue Feb 03 15:01:47 2009 -0800
     5.3 @@ -20,21 +20,21 @@
     5.4  #define INDEX_TYPE32A           0x0F    // unknown, but assumed to be similar for now
     5.5  #define INDEX_TYPE64            0x17
     5.6  #define INDEX_TYPE64A           0x15    // http://sourceforge.net/projects/libpff/
     5.7 -#define INDEX_TYPE_OFFSET       (uint64_t)0x0A
     5.8 -
     5.9 -#define FILE_SIZE_POINTER32     (uint64_t)0xA8
    5.10 -#define INDEX_POINTER32         (uint64_t)0xC4
    5.11 -#define INDEX_BACK32            (uint64_t)0xC0
    5.12 -#define SECOND_POINTER32        (uint64_t)0xBC
    5.13 -#define SECOND_BACK32           (uint64_t)0xB8
    5.14 -#define ENC_TYPE32              (uint64_t)0x1CD
    5.15 -
    5.16 -#define FILE_SIZE_POINTER64     (uint64_t)0xB8
    5.17 -#define INDEX_POINTER64         (uint64_t)0xF0
    5.18 -#define INDEX_BACK64            (uint64_t)0xE8
    5.19 -#define SECOND_POINTER64        (uint64_t)0xE0
    5.20 -#define SECOND_BACK64           (uint64_t)0xD8
    5.21 -#define ENC_TYPE64              (uint64_t)0x201
    5.22 +#define INDEX_TYPE_OFFSET       (int64_t)0x0A
    5.23 +
    5.24 +#define FILE_SIZE_POINTER32     (int64_t)0xA8
    5.25 +#define INDEX_POINTER32         (int64_t)0xC4
    5.26 +#define INDEX_BACK32            (int64_t)0xC0
    5.27 +#define SECOND_POINTER32        (int64_t)0xBC
    5.28 +#define SECOND_BACK32           (int64_t)0xB8
    5.29 +#define ENC_TYPE32              (int64_t)0x1CD
    5.30 +
    5.31 +#define FILE_SIZE_POINTER64     (int64_t)0xB8
    5.32 +#define INDEX_POINTER64         (int64_t)0xF0
    5.33 +#define INDEX_BACK64            (int64_t)0xE8
    5.34 +#define SECOND_POINTER64        (int64_t)0xE0
    5.35 +#define SECOND_BACK64           (int64_t)0xD8
    5.36 +#define ENC_TYPE64              (int64_t)0x201
    5.37  
    5.38  #define FILE_SIZE_POINTER ((pf->do_read64) ? FILE_SIZE_POINTER64 : FILE_SIZE_POINTER32)
    5.39  #define INDEX_POINTER     ((pf->do_read64) ? INDEX_POINTER64     : INDEX_POINTER32)
    5.40 @@ -813,7 +813,7 @@
    5.41  }
    5.42  
    5.43  
    5.44 -int pst_build_id_ptr(pst_file *pf, uint64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val) {
    5.45 +int pst_build_id_ptr(pst_file *pf, int64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val) {
    5.46      struct pst_table_ptr_structn table, table2;
    5.47      pst_index_ll *i_ptr=NULL;
    5.48      pst_index index;
    5.49 @@ -926,7 +926,7 @@
    5.50  }
    5.51  
    5.52  
    5.53 -int pst_build_desc_ptr (pst_file *pf, uint64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val) {
    5.54 +int pst_build_desc_ptr (pst_file *pf, int64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val) {
    5.55      struct pst_table_ptr_structn table, table2;
    5.56      pst_descn desc_rec;
    5.57      int32_t item_count;
    5.58 @@ -1091,8 +1091,9 @@
    5.59      list = NULL; //pst_process will free the items in the list
    5.60  
    5.61      if ((id_ptr = pst_getID2(id2_head, (uint64_t)0x671))) {
    5.62 -        // attachments exist - so we will process them
    5.63 +        // should not have any existing attachments anyway
    5.64          while (item->attach) {
    5.65 +            DEBUG_EMAIL(("throw away existing attachment\n"));
    5.66              attach = item->attach->next;
    5.67              free(item->attach);
    5.68              item->attach = attach;
    5.69 @@ -1101,10 +1102,8 @@
    5.70          DEBUG_EMAIL(("ATTACHMENT processing attachment\n"));
    5.71          if ((list = pst_parse_block(pf, id_ptr->id, id2_head, NULL)) == NULL) {
    5.72              DEBUG_WARN(("ERROR error processing main attachment record\n"));
    5.73 -            //if (item) pst_freeItem(item);
    5.74              if (id2_head) pst_free_id2(id2_head);
    5.75              DEBUG_RET();
    5.76 -            //return NULL;
    5.77              return item;
    5.78          }
    5.79          else {
    5.80 @@ -4118,7 +4117,7 @@
    5.81                   is non-NULL, it will first be free()d
    5.82   * @return       size of block read into memory
    5.83   */
    5.84 -size_t pst_read_block_size(pst_file *pf, uint64_t offset, size_t size, char **buf) {
    5.85 +size_t pst_read_block_size(pst_file *pf, int64_t offset, size_t size, char **buf) {
    5.86      size_t rsize;
    5.87      DEBUG_ENT("pst_read_block_size");
    5.88      DEBUG_READ(("Reading block from %#"PRIx64", %x bytes\n", offset, size));
    5.89 @@ -4210,7 +4209,7 @@
    5.90  }
    5.91  
    5.92  
    5.93 -uint64_t pst_getIntAtPos(pst_file *pf, uint64_t pos ) {
    5.94 +uint64_t pst_getIntAtPos(pst_file *pf, int64_t pos ) {
    5.95      uint64_t buf64;
    5.96      uint32_t buf32;
    5.97      if (pf->do_read64) {
    5.98 @@ -4235,7 +4234,7 @@
    5.99   * @return     actual read size, 0 if seek error
   5.100   */
   5.101  
   5.102 -size_t pst_getAtPos(pst_file *pf, uint64_t pos, void* buf, size_t size) {
   5.103 +size_t pst_getAtPos(pst_file *pf, int64_t pos, void* buf, size_t size) {
   5.104      size_t rc;
   5.105      DEBUG_ENT("pst_getAtPos");
   5.106  //  pst_block_recorder **t = &pf->block_head;
     6.1 --- a/src/libpst.h	Tue Feb 03 11:00:16 2009 -0800
     6.2 +++ b/src/libpst.h	Tue Feb 03 15:01:47 2009 -0800
     6.3 @@ -460,7 +460,7 @@
     6.4  
     6.5  typedef struct pst_block_recorder {
     6.6      struct pst_block_recorder  *next;
     6.7 -    uint64_t                    offset;
     6.8 +    int64_t                     offset;
     6.9      size_t                      size;
    6.10      int                         readcount;
    6.11  } pst_block_recorder;
    6.12 @@ -549,8 +549,8 @@
    6.13  pst_desc_ll*   pst_getNextDptr(pst_desc_ll* d);
    6.14  int            pst_load_extended_attributes(pst_file *pf);
    6.15  
    6.16 -int            pst_build_id_ptr(pst_file *pf, uint64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val);
    6.17 -int            pst_build_desc_ptr(pst_file *pf, uint64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val);
    6.18 +int            pst_build_id_ptr(pst_file *pf, int64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val);
    6.19 +int            pst_build_desc_ptr(pst_file *pf, int64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val);
    6.20  pst_item*      pst_getItem(pst_file *pf, pst_desc_ll *d_ptr);
    6.21  pst_item*      pst_parse_item (pst_file *pf, pst_desc_ll *d_ptr);
    6.22  pst_num_array* pst_parse_block(pst_file *pf, uint64_t block_id, pst_index2_ll *i2_head, pst_num_array *na_head);
    6.23 @@ -567,11 +567,11 @@
    6.24  pst_index_ll*  pst_getID(pst_file* pf, uint64_t id);
    6.25  pst_index_ll*  pst_getID2(pst_index2_ll * ptr, uint64_t id);
    6.26  pst_desc_ll*   pst_getDptr(pst_file *pf, uint64_t id);
    6.27 -size_t         pst_read_block_size(pst_file *pf, uint64_t offset, size_t size, char **buf);
    6.28 +size_t         pst_read_block_size(pst_file *pf, int64_t offset, size_t size, char **buf);
    6.29  int            pst_decrypt(uint64_t id, char *buf, size_t size, unsigned char type);
    6.30  uint64_t       pst_getIntAt(pst_file *pf, char *buf);
    6.31 -uint64_t       pst_getIntAtPos(pst_file *pf, uint64_t pos);
    6.32 -size_t         pst_getAtPos(pst_file *pf, uint64_t pos, void* buf, size_t size);
    6.33 +uint64_t       pst_getIntAtPos(pst_file *pf, int64_t pos);
    6.34 +size_t         pst_getAtPos(pst_file *pf, int64_t pos, void* buf, size_t size);
    6.35  size_t         pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, char **b);
    6.36  size_t         pst_ff_getIDblock(pst_file *pf, uint64_t id, char** b);
    6.37  size_t         pst_ff_getID2block(pst_file *pf, uint64_t id2, pst_index2_ll *id2_head, char** buf);
     7.1 --- a/src/readpst.c	Tue Feb 03 11:00:16 2009 -0800
     7.2 +++ b/src/readpst.c	Tue Feb 03 15:01:47 2009 -0800
     7.3 @@ -922,7 +922,6 @@
     7.4      int attach_num;
     7.5      time_t em_time;
     7.6      char *c_time;
     7.7 -    pst_item_attach* current_attach;
     7.8      int has_from, has_subject, has_to, has_cc, has_bcc, has_date;
     7.9      has_from = has_subject = has_to = has_cc = has_bcc = has_date = 0;
    7.10      DEBUG_ENT("write_normal_email");
    7.11 @@ -1000,6 +999,7 @@
    7.12          header_strip_field(item->email->header, "\nContent-Transfer-Encoding: ");
    7.13          header_strip_field(item->email->header, "\nContent-class: ");
    7.14          header_strip_field(item->email->header, "\nX-MimeOLE: ");
    7.15 +        header_strip_field(item->email->header, "\nBcc: ");
    7.16      }
    7.17  
    7.18      DEBUG_EMAIL(("About to print Header\n"));
    7.19 @@ -1096,56 +1096,61 @@
    7.20      }
    7.21  
    7.22      if (item->email->rtf_compressed && save_rtf) {
    7.23 +        pst_item_attach* attach = (pst_item_attach*)xmalloc(sizeof(pst_item_attach));
    7.24          DEBUG_EMAIL(("Adding RTF body as attachment\n"));
    7.25 -        current_attach = (pst_item_attach*)xmalloc(sizeof(pst_item_attach));
    7.26 -        memset(current_attach, 0, sizeof(pst_item_attach));
    7.27 -        current_attach->next = item->attach;
    7.28 -        item->attach = current_attach;
    7.29 -        current_attach->data = lzfu_decompress(item->email->rtf_compressed, item->email->rtf_compressed_size, &current_attach->size);
    7.30 -        current_attach->filename2 = xmalloc(strlen(RTF_ATTACH_NAME)+2);
    7.31 -        strcpy(current_attach->filename2, RTF_ATTACH_NAME);
    7.32 -        current_attach->mimetype = xmalloc(strlen(RTF_ATTACH_TYPE)+2);
    7.33 -        strcpy(current_attach->mimetype, RTF_ATTACH_TYPE);
    7.34 +        memset(attach, 0, sizeof(pst_item_attach));
    7.35 +        attach->next = item->attach;
    7.36 +        item->attach = attach;
    7.37 +        attach->data = lzfu_decompress(item->email->rtf_compressed, item->email->rtf_compressed_size, &attach->size);
    7.38 +        attach->filename2 = strdup(RTF_ATTACH_NAME);
    7.39 +        attach->mimetype  = strdup(RTF_ATTACH_TYPE);
    7.40      }
    7.41  
    7.42      if (item->email->encrypted_body || item->email->encrypted_htmlbody) {
    7.43          // if either the body or htmlbody is encrypted, add them as attachments
    7.44          if (item->email->encrypted_body) {
    7.45 +            pst_item_attach* attach = (pst_item_attach*)xmalloc(sizeof(pst_item_attach));
    7.46              DEBUG_EMAIL(("Adding Encrypted Body as attachment\n"));
    7.47 -            current_attach = (pst_item_attach*) xmalloc(sizeof(pst_item_attach));
    7.48 -            memset(current_attach, 0, sizeof(pst_item_attach));
    7.49 -            current_attach->next = item->attach;
    7.50 -            item->attach = current_attach;
    7.51 -            current_attach->data = item->email->encrypted_body;
    7.52 -            current_attach->size = item->email->encrypted_body_size;
    7.53 +            attach = (pst_item_attach*) xmalloc(sizeof(pst_item_attach));
    7.54 +            memset(attach, 0, sizeof(pst_item_attach));
    7.55 +            attach->next = item->attach;
    7.56 +            item->attach = attach;
    7.57 +            attach->data = item->email->encrypted_body;
    7.58 +            attach->size = item->email->encrypted_body_size;
    7.59              item->email->encrypted_body = NULL;
    7.60          }
    7.61  
    7.62          if (item->email->encrypted_htmlbody) {
    7.63 +            pst_item_attach* attach = (pst_item_attach*)xmalloc(sizeof(pst_item_attach));
    7.64              DEBUG_EMAIL(("Adding encrypted HTML body as attachment\n"));
    7.65 -            current_attach = (pst_item_attach*) xmalloc(sizeof(pst_item_attach));
    7.66 -            memset(current_attach, 0, sizeof(pst_item_attach));
    7.67 -            current_attach->next = item->attach;
    7.68 -            item->attach = current_attach;
    7.69 -            current_attach->data = item->email->encrypted_htmlbody;
    7.70 -            current_attach->size = item->email->encrypted_htmlbody_size;
    7.71 +            attach = (pst_item_attach*) xmalloc(sizeof(pst_item_attach));
    7.72 +            memset(attach, 0, sizeof(pst_item_attach));
    7.73 +            attach->next = item->attach;
    7.74 +            item->attach = attach;
    7.75 +            attach->data = item->email->encrypted_htmlbody;
    7.76 +            attach->size = item->email->encrypted_htmlbody_size;
    7.77              item->email->encrypted_htmlbody = NULL;
    7.78          }
    7.79          write_email_body(f_output, "The body of this email is encrypted. This isn't supported yet, but the body is now an attachment\n");
    7.80      }
    7.81  
    7.82      // other attachments
    7.83 -    attach_num = 0;
    7.84 -    for (current_attach = item->attach; current_attach; current_attach = current_attach->next) {
    7.85 -        DEBUG_EMAIL(("Attempting Attachment encoding\n"));
    7.86 -        if (!current_attach->data) {
    7.87 -            DEBUG_EMAIL(("Data of attachment is NULL!. Size is supposed to be %i\n", current_attach->size));
    7.88 +    {
    7.89 +        pst_item_attach* attach;
    7.90 +        attach_num = 0;
    7.91 +        for (attach = item->attach; attach; attach = attach->next) {
    7.92 +            DEBUG_EMAIL(("Attempting Attachment encoding\n"));
    7.93 +            if (!attach->data) {
    7.94 +                DEBUG_EMAIL(("Data of attachment is NULL!. Size is supposed to be %i\n", attach->size));
    7.95 +            }
    7.96 +            if (mode == MODE_SEPARATE && !mode_MH)
    7.97 +                write_separate_attachment(f_name, attach, ++attach_num, pst);
    7.98 +            else
    7.99 +                write_inline_attachment(f_output, attach, boundary, pst);
   7.100          }
   7.101 -        if (mode == MODE_SEPARATE && !mode_MH)
   7.102 -            write_separate_attachment(f_name, current_attach, ++attach_num, pst);
   7.103 -        else
   7.104 -            write_inline_attachment(f_output, current_attach, boundary, pst);
   7.105      }
   7.106 +
   7.107 +    // end of this mail message
   7.108      if (mode != MODE_SEPARATE) { /* do not add a boundary after the last attachment for mode_MH */
   7.109          DEBUG_EMAIL(("Writing buffer between emails\n"));
   7.110          fprintf(f_output, "\n--%s--\n", boundary);
     8.1 --- a/src/readpstlog.c	Tue Feb 03 11:00:16 2009 -0800
     8.2 +++ b/src/readpstlog.c	Tue Feb 03 15:01:47 2009 -0800
     8.3 @@ -68,13 +68,13 @@
     8.4      buf = (char*) xmalloc(BUF_SIZE);
     8.5  
     8.6      while (!stop) {
     8.7 -        uint64_t temp;
     8.8 -        if (fread(&temp, sizeof(uint64_t), 1, fp)<=0) break;
     8.9 +        int64_t temp;
    8.10 +        if (fread(&temp, sizeof(int64_t), 1, fp)<=0) break;
    8.11          x = (int)temp;
    8.12          ptr = 0;
    8.13          if (x > 0) {
    8.14 -            uint64_t i[x+1]; // plus 1 because we want to read the offset of the next index
    8.15 -            if (get(i, sizeof(uint64_t), x+1, fp)==0) {
    8.16 +            int64_t i[x+1]; // plus 1 because we want to read the offset of the next index
    8.17 +            if (get(i, sizeof(int64_t), x+1, fp)==0) {
    8.18                  // we have reached the end of the debug file
    8.19                  printf("oh dear. we must now end\n");
    8.20                  break;