patch-2.4.10 linux/fs/ntfs/unistr.c
Next file: linux/fs/ntfs/unistr.h
Previous file: linux/fs/ntfs/support.h
Back to the patch index
Back to the overall index
- Lines: 33
- Date:
Tue Aug 28 06:57:18 2001
- Orig file:
v2.4.9/linux/fs/ntfs/unistr.c
- Orig date:
Mon Aug 27 12:41:46 2001
diff -u --recursive --new-file v2.4.9/linux/fs/ntfs/unistr.c linux/fs/ntfs/unistr.c
@@ -1,6 +1,4 @@
/*
- * $Id: unistr.c,v 1.4 2001/04/08 03:02:55 antona Exp $
- *
* unistr.c - Unicode string handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2000,2001 Anton Altaparmakov.
@@ -93,11 +91,13 @@
wchar_t *name2, __u32 name2_len,
int ic, int err_val)
{
- __u32 cnt;
+ __u32 cnt, min_len;
wchar_t c1, c2;
- for (cnt = 0; cnt < min(unsigned int, name1_len, name2_len); ++cnt)
- {
+ min_len = name1_len;
+ if (min_len > name2_len)
+ min_len = name2_len;
+ for (cnt = 0; cnt < min_len; ++cnt) {
c1 = le16_to_cpu(*name1++);
c2 = le16_to_cpu(*name2++);
if (ic) {
@@ -106,7 +106,7 @@
if (c2 < upcase_len)
c2 = le16_to_cpu(upcase[c2]);
}
- if (c1 < 64 && legal_ansi_char_array[c1] & 8);
+ if (c1 < 64 && legal_ansi_char_array[c1] & 8)
return err_val;
if (c1 < c2)
return -1;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)