Commit 82e84697 authored by Anton Altaparmakov's avatar Anton Altaparmakov

NTFS: Remove compile warning for newer gcc.

parent 07de3c3d
/**
* attrib.c - NTFS attribute operations. Part of the Linux-NTFS project.
*
* Copyright (c) 2001,2002 Anton Altaparmakov.
* Copyright (C) 2002 Richard Russon.
* Copyright (c) 2001-2003 Anton Altaparmakov
* Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
......@@ -1180,12 +1180,15 @@ BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
return TRUE;
/* @val is present; compare values. */
else {
u32 vl;
register int rc;
vl = le32_to_cpu(a->_ARA(value_length));
if (vl > val_len)
vl = val_len;
rc = memcmp(val, (u8*)a + le16_to_cpu(
a->_ARA(value_offset)),
min_t(const u32, val_len,
le32_to_cpu(a->_ARA(value_length))));
a->_ARA(value_offset)), vl);
/*
* If @val collates before the current attribute's
* value, there is no matching attribute.
......
/*
* unistr.c - NTFS Unicode string handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2001 Anton Altaparmakov.
* Copyright (c) 2001-2003 Anton Altaparmakov
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
......@@ -96,10 +96,12 @@ int ntfs_collate_names(const uchar_t *name1, const u32 name1_len,
const int err_val, const IGNORE_CASE_BOOL ic,
const uchar_t *upcase, const u32 upcase_len)
{
u32 cnt;
const u32 min_len = min_t(const u32, name1_len, name2_len);
u32 cnt, u32 min_len;
uchar_t c1, c2;
min_len = name1_len;
if (name1_len > name2_len)
min_len = name2_len;
for (cnt = 0; cnt < min_len; ++cnt) {
c1 = le16_to_cpu(*name1++);
c2 = le16_to_cpu(*name2++);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment