]> wimlib.net Git - wimlib/commitdiff
Misc. fixes
authorEric Biggers <ebiggers3@gmail.com>
Sat, 18 May 2013 03:34:08 +0000 (22:34 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 18 May 2013 03:34:08 +0000 (22:34 -0500)
src/header.c
src/lookup_table.c
src/reparse.c
src/unix_capture.c
src/util.c

index 0066d75a3ba7b6d9d5db40a506c4fb9b75154327..5a665fc25113db71eec709ca697cd063839c5943 100644 (file)
@@ -72,7 +72,7 @@ struct wim_header_disk {
         * the only supported value).  */
        u32 chunk_size;
 
-       /* Globally unique identifier for the WIM file.  Basically bunch of
+       /* Globally unique identifier for the WIM file.  Basically bunch of
         * random bytes. */
        u8 guid[WIM_GID_LEN];
 
@@ -102,9 +102,9 @@ struct wim_header_disk {
        u32 boot_idx;
 
        /* Location and size of the WIM's integrity table, or all zeroes if the
-        * WIM has no integrity table. */
-
-       /* Note the integrity_table_res_entry here is 4-byte aligned even though
+        * WIM has no integrity table.
+        *
+        * Note the integrity_table_res_entry here is 4-byte aligned even though
         * it would ordinarily be 8-byte aligned--- hence, the _packed_attribute
         * on the `struct wim_header_disk' is essential. */
        struct resource_entry_disk integrity_table_res_entry;
index 95708866c9197614588f23ecc0caa26ceac71d02..f3d8c537d4237730d89ca24a56545f2c05225bdb 100644 (file)
@@ -355,10 +355,10 @@ struct wim_lookup_table_entry_disk {
        struct resource_entry_disk resource_entry;
 
        /* Which part of the split WIM this stream is in; indexed from 1. */
-       u16 part_number;
+       le16 part_number;
 
        /* Reference count of this stream over all WIM images. */
-       u32 refcnt;
+       le32 refcnt;
 
        /* SHA1 message digest of the uncompressed data of this stream, or
         * optionally all zeroes if this stream is of zero length. */
index 505910979d06cf24049d741f3052608d2a5429d5..b097212a6738afd803a911553f112dcb2055667d 100644 (file)
@@ -186,7 +186,7 @@ parse_reparse_data(const u8 * restrict rpbuf, u16 rpbuflen,
        if (rpdata->rptag == WIM_IO_REPARSE_TAG_SYMLINK) {
                if (rpbuflen < 20)
                        goto out_invalid;
-               rpdata->rpflags = le16_to_cpu(rpbuf_disk->symlink.rpflags);
+               rpdata->rpflags = le32_to_cpu(rpbuf_disk->symlink.rpflags);
                data = rpbuf_disk->symlink.data;
        } else {
                data = rpbuf_disk->junction.data;
index eb3005d41f504af88d5355faafd6f48b85cc5fc6..906920a86144dc9549b58975e694691d6c8563ee 100644 (file)
@@ -145,12 +145,9 @@ unix_capture_symlink(struct wim_dentry **root_p,
        inode->i_attributes = FILE_ATTRIBUTE_REPARSE_POINT;
        inode->i_reparse_tag = WIM_IO_REPARSE_TAG_SYMLINK;
 
-       /* The idea here is to call readlink() to get the UNIX target of
-        * the symbolic link, then turn the target into a reparse point
-        * data buffer that contains a relative or absolute symbolic
-        * link (NOT a junction point or *full* path symbolic link with
-        * drive letter).
-        */
+       /* The idea here is to call readlink() to get the UNIX target of the
+        * symbolic link, then turn the target into a reparse point data buffer
+        * that contains a relative or absolute symbolic link. */
        deref_name_len = readlink(path, deref_name_buf,
                                  sizeof(deref_name_buf) - 1);
        if (deref_name_len >= 0) {
index a0ed84d95014760cff7f0b95618c1fcb78c1d943..6b93e2a93bab0daf16e0c20c990fa871d7b005c7 100644 (file)
@@ -439,7 +439,7 @@ void *
 wimlib_calloc(size_t nmemb, size_t size)
 {
        size_t total_size = nmemb * size;
-       void *p = (*wimlib_malloc_func)(total_size);
+       void *p = MALLOC(total_size);
        if (p)
                p = memset(p, 0, total_size);
        return p;
@@ -452,9 +452,9 @@ wimlib_strdup(const char *str)
        char *p;
 
        size = strlen(str);
-       p = (*wimlib_malloc_func)(size + 1);
+       p = MALLOC(size + 1);
        if (p)
-               memcpy(p, str, size + 1);
+               p = memcpy(p, str, size + 1);
        return p;
 }
 
@@ -466,7 +466,7 @@ wimlib_wcsdup(const wchar_t *str)
        wchar_t *p;
 
        size = wcslen(str);
-       p = (*wimlib_malloc_func)((size + 1) * sizeof(wchar_t));
+       p = MALLOC((size + 1) * sizeof(wchar_t));
        if (p)
                p = wmemcpy(p, str, size + 1);
        return p;