From 69423166cb7573d026ba983254daffbe8f84251e Mon Sep 17 00:00:00 2001 From: szaka Date: Wed, 2 Apr 2008 10:29:22 +0000 Subject: [PATCH] fix: symlink failed or the size was truncated at modulo 256 if the target was over 255 bytes --- include/ntfs-3g/dir.h | 2 +- libntfs-3g/dir.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ntfs-3g/dir.h b/include/ntfs-3g/dir.h index f116cd6a..b1c90300 100644 --- a/include/ntfs-3g/dir.h +++ b/include/ntfs-3g/dir.h @@ -73,7 +73,7 @@ extern ntfs_inode *ntfs_create(ntfs_inode *dir_ni, le32 securid, extern ntfs_inode *ntfs_create_device(ntfs_inode *dir_ni, le32 securid, ntfschar *name, u8 name_len, dev_t type, dev_t dev); extern ntfs_inode *ntfs_create_symlink(ntfs_inode *dir_ni, le32 securid, - ntfschar *name, u8 name_len, ntfschar *target, u8 target_len); + ntfschar *name, u8 name_len, ntfschar *target, int target_len); extern int ntfs_check_empty_dir(ntfs_inode *ni); extern int ntfs_delete(ntfs_volume *vol, const char *path, ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, diff --git a/libntfs-3g/dir.c b/libntfs-3g/dir.c index d0f5a92d..4eeab822 100644 --- a/libntfs-3g/dir.c +++ b/libntfs-3g/dir.c @@ -1157,7 +1157,7 @@ err_out: */ static ntfs_inode *__ntfs_create(ntfs_inode *dir_ni, le32 securid, ntfschar *name, u8 name_len, dev_t type, dev_t dev, - ntfschar *target, u8 target_len) + ntfschar *target, int target_len) { ntfs_inode *ni; int rollback_data = 0, rollback_sd = 0; @@ -1420,7 +1420,7 @@ ntfs_inode *ntfs_create_device(ntfs_inode *dir_ni, le32 securid, } ntfs_inode *ntfs_create_symlink(ntfs_inode *dir_ni, le32 securid, - ntfschar *name, u8 name_len, ntfschar *target, u8 target_len) + ntfschar *name, u8 name_len, ntfschar *target, int target_len) { if (!target || !target_len) { ntfs_log_error("Invalid arguments.\n");