/* XXX Fix absolute paths */
u8 *p = buf;
- p = put_u16(p, 0); /* Substitute name offset */
+ p = put_u16(p, utf16_len); /* Substitute name offset */
p = put_u16(p, utf16_len); /* Substitute name length */
- p = put_u16(p, utf16_len); /* Print name offset */
+ p = put_u16(p, 0); /* Print name offset */
p = put_u16(p, utf16_len); /* Print name length */
p = put_u32(p, 1);
p = put_bytes(p, utf16_len, name_utf16);
return buf;
}
-/* Get the symlink target from a dentry that's already checked to be either a
- * "real" symlink or a junction point. */
+/* Get the symlink target from a dentry.
+ *
+ * The dentry may be either "real" symlink or a junction point.
+ */
ssize_t dentry_readlink(const struct dentry *dentry, char *buf, size_t buf_len,
const WIMStruct *w)
{
wimlib_assert(dentry->num_ads == 0);
wimlib_assert(dentry->ads_entries == NULL);
- ads_entries[1].lte = lte;
+ ads_entries[0].lte = lte;
/*dentry_free_ads_entries(dentry);*/
dentry->num_ads = 2;