diff options
author | pfg <pfg@FreeBSD.org> | 2012-01-03 19:09:01 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2012-01-03 19:09:01 +0000 |
commit | 02096cd0ef62b971cbdf350d8a36a6182e5bb983 (patch) | |
tree | fcf05cada798225e2a3f04e72916c0d413ff8c54 | |
parent | e7e5b53bf16ab3b35646f0580b36fa7d7afa9678 (diff) | |
download | FreeBSD-src-02096cd0ef62b971cbdf350d8a36a6182e5bb983.zip FreeBSD-src-02096cd0ef62b971cbdf350d8a36a6182e5bb983.tar.gz |
Minor cleanups to ntfs code
bzero -> memset
rename variables to avoid shadowing.
PR: 142401
Obtained from: NetBSD
Approved by jhb (mentor)
-rw-r--r-- | sys/fs/ntfs/ntfs_compr.c | 10 | ||||
-rw-r--r-- | sys/fs/ntfs/ntfs_subr.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/fs/ntfs/ntfs_compr.c b/sys/fs/ntfs/ntfs_compr.c index 6816220..dcc82a3 100644 --- a/sys/fs/ntfs/ntfs_compr.c +++ b/sys/fs/ntfs/ntfs_compr.c @@ -42,7 +42,7 @@ int ntfs_uncompblock( - u_int8_t * buf, + u_int8_t * dbuf, u_int8_t * cbuf) { u_int32_t ctag; @@ -60,8 +60,8 @@ ntfs_uncompblock( dprintf(("ntfs_uncompblock: len: %x instead of %d\n", len, 0xfff)); } - memcpy(buf, cbuf + 2, len + 1); - bzero(buf + len + 1, NTFS_COMPBLOCK_SIZE - 1 - len); + memcpy(dbuf, cbuf + 2, len + 1); + memset(dbuf + len + 1, 0, NTFS_COMPBLOCK_SIZE - 1 - len); return len + 3; } cpos = 2; @@ -78,12 +78,12 @@ ntfs_uncompblock( boff = -1 - (GET_UINT16(cbuf + cpos) >> dshift); blen = 3 + (GET_UINT16(cbuf + cpos) & lmask); for (j = 0; (j < blen) && (pos < NTFS_COMPBLOCK_SIZE); j++) { - buf[pos] = buf[pos + boff]; + dbuf[pos] = dbuf[pos + boff]; pos++; } cpos += 2; } else { - buf[pos++] = cbuf[cpos++]; + dbuf[pos++] = cbuf[cpos++]; } ctag >>= 1; } diff --git a/sys/fs/ntfs/ntfs_subr.c b/sys/fs/ntfs/ntfs_subr.c index b223f87..9d81f71 100644 --- a/sys/fs/ntfs/ntfs_subr.c +++ b/sys/fs/ntfs/ntfs_subr.c @@ -1636,7 +1636,7 @@ ntfs_readntvattr_plain( for(; remains; remains--) uiomove("", 1, uio); } else - bzero(data, tocopy); + memset(data, 0, tocopy); data = data + tocopy; } cnt++; @@ -1783,7 +1783,7 @@ ntfs_readattr( uiomove("", 1, uio); } else - bzero(data, tocopy); + memset(data, 0, tocopy); } else { error = ntfs_uncompunit(ntmp, uup, cup); if (error) |