Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16871/ntfsprogs
Modified Files:
ntfsrm.c ntfsundelete.c utils.c
Log Message:
Make @outs_len to be 0 when @**outs NULL in ntfs_ucstombs calls. Previous code
it correct since @outs_len is ingored when @**outs == NULL, but may confuse
because it was equal to @ins_len what is incorrect (eg. international utf8
characters).
Index: ntfsrm.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsrm.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -p -r1.46 -r1.47
--- ntfsrm.c 19 Jul 2005 01:56:41 -0000 1.46
+++ ntfsrm.c 19 Jul 2005 23:13:26 -0000 1.47
@@ -1270,7 +1270,7 @@ static int ntfs_dt_count_root (struct nt
}
if (!(entry->flags & INDEX_ENTRY_END)) {
- ntfs_ucstombs (entry->key.file_name.file_name, entry->key.file_name.file_name_length, &name, entry->key.file_name.file_name_length);
+ ntfs_ucstombs (entry->key.file_name.file_name, entry->key.file_name.file_name_length, &name, 0);
//printf ("\tinode %8lld %s\n", MREF (entry->indexed_file), name);
free (name);
name = NULL;
@@ -1337,7 +1337,7 @@ static int ntfs_dt_count_alloc (struct n
if (entry->flags & INDEX_ENTRY_END) {
break;
} else {
- ntfs_ucstombs (entry->key.file_name.file_name, entry->key.file_name.file_name_length, &name, entry->key.file_name.file_name_length);
+ ntfs_ucstombs (entry->key.file_name.file_name, entry->key.file_name.file_name_length, &name, 0);
//printf ("\tinode %8lld %s\n", MREF (entry->indexed_file), name);
free (name);
name = NULL;
Index: ntfsundelete.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsundelete.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -p -r1.41 -r1.42
--- ntfsundelete.c 6 Jul 2005 22:47:20 -0000 1.41
+++ ntfsundelete.c 19 Jul 2005 23:13:27 -0000 1.42
@@ -882,7 +882,7 @@ static int get_filenames (struct ufile *
name->date_r = ntfs2utc (sle64_to_cpu (attr->last_access_time));
if (ntfs_ucstombs (name->uname, name->uname_len, &name->name,
- name->uname_len) < 0) {
+ 0) < 0) {
Dprintf ("ERROR: Couldn't translate filename to current locale.\n");
}
@@ -957,7 +957,7 @@ static int get_data (struct ufile *file,
data->uname_len = rec->name_length;
if (ntfs_ucstombs (data->uname, data->uname_len, &data->name,
- data->uname_len) < 0) {
+ 0) < 0) {
Eprintf ("ERROR: Cannot translate name into current locale.\n");
}
}
Index: utils.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/utils.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -r1.36 -r1.37
--- utils.c 13 Jul 2005 00:50:52 -0000 1.36
+++ utils.c 19 Jul 2005 23:13:27 -0000 1.37
@@ -461,7 +461,7 @@ int utils_inode_get_name (ntfs_inode *in
}
if (ntfs_ucstombs (attr->file_name, attr->file_name_length,
- &names[i], attr->file_name_length) < 0) {
+ &names[i], 0) < 0) {
char *temp;
Eprintf ("Couldn't translate filename to current locale.\n");
temp = malloc (30);
@@ -542,7 +542,7 @@ int utils_attr_get_name (ntfs_volume *vo
if (attrdef) {
name = NULL;
namelen = ntfs_ucsnlen (attrdef->name, sizeof (attrdef->name));
- if (ntfs_ucstombs (attrdef->name, namelen, &name, namelen) < 0) {
+ if (ntfs_ucstombs (attrdef->name, namelen, &name, 0) < 0) {
Eprintf ("Couldn't translate attribute type to current locale.\n");
// <UNKNOWN>?
return 0;
@@ -568,7 +568,7 @@ int utils_attr_get_name (ntfs_volume *vo
name = NULL;
namelen = attr->name_length;
if (ntfs_ucstombs ((ntfschar *)((char *)attr + attr->name_offset),
- namelen, &name, namelen) < 0) {
+ namelen, &name, 0) < 0) {
Eprintf ("Couldn't translate attribute name to current locale.\n");
// <UNKNOWN>?
len = snprintf (buffer, bufsize, "<UNKNOWN>");
|