comparison src/libpst.c @ 114:e213bfcf9aa7 stable-0-6-24

patch from Chris Eagle to build on cygwin
author Carl Byington <carl@five-ten-sg.com>
date Thu, 11 Dec 2008 11:58:22 -0800
parents 7133b39975f7
children ed2a260bbb98
comparison
equal deleted inserted replaced
113:f04499f1ef90 114:e213bfcf9aa7
491 return r; 491 return r;
492 } 492 }
493 493
494 494
495 typedef struct pst_x_attrib { 495 typedef struct pst_x_attrib {
496 uint16_t extended; 496 uint32_t extended;
497 uint16_t zero;
498 uint16_t type; 497 uint16_t type;
499 uint16_t map; 498 uint16_t map;
500 } pst_x_attrib; 499 } pst_x_attrib;
501 500
502 501
558 DEBUG_RET(); 557 DEBUG_RET();
559 return 0; 558 return 0;
560 } 559 }
561 560
562 memcpy(&xattrib, &(buffer[bptr]), sizeof(xattrib)); 561 memcpy(&xattrib, &(buffer[bptr]), sizeof(xattrib));
563 LE16_CPU(xattrib.extended); 562 LE32_CPU(xattrib.extended);
564 LE16_CPU(xattrib.zero);
565 LE16_CPU(xattrib.type); 563 LE16_CPU(xattrib.type);
566 LE16_CPU(xattrib.map); 564 LE16_CPU(xattrib.map);
567 bptr += sizeof(xattrib); 565 bptr += sizeof(xattrib);
568 566
569 while (xattrib.type != 0 && bptr < bsize) { 567 while (xattrib.type != 0 && bptr < bsize) {
570 ptr = (pst_x_attrib_ll*) xmalloc(sizeof(*ptr)); 568 ptr = (pst_x_attrib_ll*) xmalloc(sizeof(*ptr));
571 memset(ptr, 0, sizeof(*ptr)); 569 memset(ptr, 0, sizeof(*ptr));
572 ptr->type = xattrib.type; 570 ptr->type = xattrib.type;
573 ptr->map = xattrib.map+0x8000; 571 ptr->map = xattrib.map+0x8000;
574 ptr->next = NULL; 572 ptr->next = NULL;
575 DEBUG_INDEX(("xattrib: ext = %#hx, zero = %#hx, type = %#hx, map = %#hx\n", 573 DEBUG_INDEX(("xattrib: ext = %#x, type = %#hx, map = %#hx\n",
576 xattrib.extended, xattrib.zero, xattrib.type, xattrib.map)); 574 xattrib.extended, xattrib.type, xattrib.map));
577 err=0; 575 err=0;
578 if (xattrib.type & 0x0001) { // if the Bit 1 is set 576 if (xattrib.type & 0x0001) { // if the Bit 1 is set
579 // pointer to Unicode field in buffer 577 // pointer to Unicode field in buffer
580 if (xattrib.extended < hsize) { 578 if (xattrib.extended < hsize) {
581 char *wt; 579 char *wt;
621 } else { 619 } else {
622 free(ptr); 620 free(ptr);
623 ptr = NULL; 621 ptr = NULL;
624 } 622 }
625 memcpy(&xattrib, &(buffer[bptr]), sizeof(xattrib)); 623 memcpy(&xattrib, &(buffer[bptr]), sizeof(xattrib));
626 LE16_CPU(xattrib.extended); 624 LE32_CPU(xattrib.extended);
627 LE16_CPU(xattrib.zero);
628 LE16_CPU(xattrib.type); 625 LE16_CPU(xattrib.type);
629 LE16_CPU(xattrib.map); 626 LE16_CPU(xattrib.map);
630 bptr += sizeof(xattrib); 627 bptr += sizeof(xattrib);
631 } 628 }
632 if (id2_head) pst_free_id2(id2_head); 629 if (id2_head) pst_free_id2(id2_head);