comparison src/dumpblocks.c @ 87:3ec5ad97e926

Use inttypes.h for portable printing of 64 bit items.
author Carl Byington <carl@five-ten-sg.com>
date Sun, 03 Aug 2008 15:42:37 -0700
parents 87216aefc6df
children 0f1492b7fe8b
comparison
equal deleted inserted replaced
86:7d8cc1712221 87:3ec5ad97e926
67 } else { 67 } else {
68 c = pst_ff_getIDblock(&pstfile, ptr->id, &buf); 68 c = pst_ff_getIDblock(&pstfile, ptr->id, &buf);
69 } 69 }
70 70
71 if (c > 0) { 71 if (c > 0) {
72 snprintf(outname, OUT_BUF, "%llx", ptr->id); 72 snprintf(outname, OUT_BUF, "%#"PRIx64, ptr->id);
73 if ((fp = fopen(outname, "wb")) == NULL) { 73 if ((fp = fopen(outname, "wb")) == NULL) {
74 printf("Failed to open file %s\n", outname); 74 printf("Failed to open file %s\n", outname);
75 continue; 75 continue;
76 } 76 }
77 pst_fwrite(buf, 1, c, fp); 77 pst_fwrite(buf, 1, c, fp);
78 fclose(fp); 78 fclose(fp);
79 } else { 79 } else {
80 printf("Failed to read block id %#llx\n", ptr->id); 80 printf("Failed to read block id %#"PRIx64"\n", ptr->id);
81 } 81 }
82 ptr = ptr->next; 82 ptr = ptr->next;
83 } 83 }
84 pst_close(&pstfile); 84 pst_close(&pstfile);
85 DEBUG_RET(); 85 DEBUG_RET();