]> wimlib.net Git - wimlib/blobdiff - src/resource.c
read_compressed_resource(): Fix format strings
[wimlib] / src / resource.c
index 8f3ba1169a353d8c6ec3c939decb895918a47293..8d61761414c9b718a1e4b0dab9312359616711ab 100644 (file)
@@ -279,9 +279,9 @@ static int read_compressed_resource(FILE *fp, u64 resource_compressed_size,
                bool is_partial_chunk = (partial_chunk_size !=
                                                uncompressed_chunk_size);
 
-               DEBUG2("start_offset = %u, end_offset = %u", start_offset,
-                                       end_offset);
-               DEBUG2("partial_chunk_size = %u", partial_chunk_size);
+               DEBUG2("start_offset = %"PRIu64", end_offset = %"PRIu64"",
+                      start_offset, end_offset);
+               DEBUG2("partial_chunk_size = %"PRIu64"", partial_chunk_size);
 
                /* This is undocumented, but chunks can be uncompressed.  This
                 * appears to always be the case when the compressed chunk size
@@ -539,8 +539,8 @@ int read_wim_resource(const struct wim_lookup_table_entry *lte, u8 buf[],
        case RESOURCE_IN_FILE_ON_DISK:
                /* The resource is in some file on the external filesystem and
                 * needs to be read uncompressed */
-               wimlib_assert(lte->file_on_disk);
-               wimlib_assert(&lte->file_on_disk == &lte->staging_file_name);
+               wimlib_assert(lte->file_on_disk != NULL);
+               BUILD_BUG_ON(&lte->file_on_disk != &lte->staging_file_name);
                /* Use existing file pointer if available; otherwise open one
                 * temporarily */
                if (lte->file_on_disk_fp) {
@@ -558,6 +558,13 @@ int read_wim_resource(const struct wim_lookup_table_entry *lte, u8 buf[],
                if (fp != lte->file_on_disk_fp)
                        fclose(fp);
                break;
+#if defined(__CYGWIN__) || defined(__WIN32__)
+       case RESOURCE_WIN32:
+               wimlib_assert(lte->file_on_disk_fp != NULL);
+               ret = win32_read_file(lte->file_on_disk, lte->file_on_disk_fp,
+                                     offset, size, buf);
+               break;
+#endif
        case RESOURCE_IN_ATTACHED_BUFFER:
                /* The resource is directly attached uncompressed in an
                 * in-memory buffer. */