From 4b408e60ae31c01e964546dbb7078cbd128dccd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 23 Mar 2011 09:27:33 +0100 Subject: [PATCH] Strenghtened types in ntfslabel and ntfsfix --- ntfsprogs/ntfsfix.c | 4 ++-- ntfsprogs/ntfslabel.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ntfsprogs/ntfsfix.c b/ntfsprogs/ntfsfix.c index 1ac60e6f..da260a4a 100644 --- a/ntfsprogs/ntfsfix.c +++ b/ntfsprogs/ntfsfix.c @@ -213,8 +213,8 @@ static int OLD_ntfs_volume_set_flags(ntfs_volume *vol, const le16 flags) "context.\n"); goto err_exit; } - if (ntfs_attr_lookup(AT_VOLUME_INFORMATION, AT_UNNAMED, 0, 0, 0, NULL, - 0, ctx)) { + if (ntfs_attr_lookup(AT_VOLUME_INFORMATION, AT_UNNAMED, 0, + CASE_SENSITIVE, 0, NULL, 0, ctx)) { ntfs_log_error("Attribute $VOLUME_INFORMATION was not found in " "$Volume!\n"); goto err_out; diff --git a/ntfsprogs/ntfslabel.c b/ntfsprogs/ntfslabel.c index 6d9beb1f..80a9dbb2 100644 --- a/ntfsprogs/ntfslabel.c +++ b/ntfsprogs/ntfslabel.c @@ -298,8 +298,8 @@ static int change_label(ntfs_volume *vol, unsigned long mnt_flags, char *label, ntfs_log_perror("Failed to get attribute search context"); goto err_out; } - if (ntfs_attr_lookup(AT_VOLUME_NAME, AT_UNNAMED, 0, 0, 0, NULL, 0, - ctx)) { + if (ntfs_attr_lookup(AT_VOLUME_NAME, AT_UNNAMED, 0, CASE_SENSITIVE, + 0, NULL, 0, ctx)) { if (errno != ENOENT) { ntfs_log_perror("Lookup of $VOLUME_NAME attribute failed"); goto err_out; @@ -325,7 +325,7 @@ static int change_label(ntfs_volume *vol, unsigned long mnt_flags, char *label, "allowed. Truncating excess characters.\n", (unsigned)(0x100 / sizeof(ntfschar))); label_len = 0x100; - new_label[label_len / sizeof(ntfschar)] = 0; + new_label[label_len / sizeof(ntfschar)] = const_cpu_to_le16(0); } if (a) { if (resize_resident_attribute_value(ctx->mrec, a, label_len)) {