From f793ead700c073b373e9519c1f51fe77b96af023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 20 Aug 2012 13:53:48 +0200 Subject: [PATCH] Cosmetic : avoided having a hardcoded knowledge of upcase table size in mkntfs --- ntfsprogs/mkntfs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c index 293addf8..b468b2bc 100644 --- a/ntfsprogs/mkntfs.c +++ b/ntfsprogs/mkntfs.c @@ -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");