fix stupid bug in ntfs_attr_truncate

(Logical change 1.619)
edge.strict_endians
(none)!yura 2004-10-18 19:35:46 +00:00
parent 89e2179873
commit fb156edd1a
1 changed files with 2 additions and 1 deletions

View File

@ -4296,7 +4296,8 @@ put_err_out:
*/
int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize)
{
if (!na || newsize < 0 || (na->ni == FILE_MFT && na->type == AT_DATA)) {
if (!na || newsize < 0 ||
(na->ni->mft_no == FILE_MFT && na->type == AT_DATA)) {
Dprintf("%s(): Invalid aruments passed.\n", __FUNCTION__);
errno = EINVAL;
return -1;