Cosmetic : avoided having a hardcoded knowledge of upcase table size in mkntfs

edge.strict_endians
Jean-Pierre André 2012-08-20 13:53:48 +02:00
parent 35eab4044e
commit f793ead700
1 changed files with 2 additions and 5 deletions

View File

@ -4918,12 +4918,9 @@ static int mkntfs_redirect(struct mkntfs_options *opts2)
if (opts.cluster_size >= 0)
g_vol->cluster_size = opts.cluster_size;
/* Length is in unicode characters. */
g_vol->upcase_len = 65536;
g_vol->upcase = ntfs_malloc(g_vol->upcase_len * sizeof(ntfschar));
if (!g_vol->upcase)
g_vol->upcase_len = ntfs_upcase_build_default(&g_vol->upcase);
if (!g_vol->upcase_len)
goto done;
ntfs_upcase_table_build(g_vol->upcase,
g_vol->upcase_len * sizeof(ntfschar));
g_vol->attrdef = ntfs_malloc(sizeof(attrdef_ntfs3x_array));
if (!g_vol->attrdef) {
ntfs_log_perror("Could not create attrdef structure");