summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-10-06 19:25:07 +0300
committerMaksym Planeta <mcsim.planeta@gmail.com>2012-10-28 12:33:36 +0100
commit1ccf6df2dff11a765707b202bac7aaaacba80ba3 (patch)
treeea71877bb3a79780218514ad335f7ce8efac4fd4
parent026d26a02eeee7378a1e6a289399eaf676edb397 (diff)
Replace deprecated functions bzero and bcopy for modern ones.
Not all functions are replaced, but rest of them will be replaced in future commits. This is done so, because these function are involved in other changes and making intermediate changes just bring unnecessary complication. * ext2fs/ext2fs.c (parse_opt): Function changed. * ext2fs/getblk.c (ext2_alloc_block): Likewise. * ext2fs/inode.c (diskfs_set_translator): Likewise. (write_symlink): Likewise. (read_symlink): Likewise.
-rw-r--r--ext2fs/ext2fs.c2
-rw-r--r--ext2fs/getblk.c2
-rw-r--r--ext2fs/inode.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
index 0857a749..42e1cc0e 100644
--- a/ext2fs/ext2fs.c
+++ b/ext2fs/ext2fs.c
@@ -106,7 +106,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
if (values == 0)
return ENOMEM;
state->hook = values;
- bzero (values, sizeof *values);
+ memset (values, 0, sizeof *values);
values->sb_block = SBLOCK_BLOCK;
break;
diff --git a/ext2fs/getblk.c b/ext2fs/getblk.c
index 3da4671e..86e94aa9 100644
--- a/ext2fs/getblk.c
+++ b/ext2fs/getblk.c
@@ -105,7 +105,7 @@ ext2_alloc_block (struct node *node, block_t goal, int zero)
if (result && zero)
{
char *bh = bptr (result);
- bzero (bh, block_size);
+ memset (bh, 0, block_size);
record_indir_poke (node, bh);
}
diff --git a/ext2fs/inode.c b/ext2fs/inode.c
index 9447723d..bda964fc 100644
--- a/ext2fs/inode.c
+++ b/ext2fs/inode.c
@@ -705,7 +705,7 @@ diskfs_set_translator (struct node *np, const char *name, unsigned namelen,
{
buf[0] = namelen & 0xFF;
buf[1] = (namelen >> 8) & 0xFF;
- bcopy (name, buf + 2, namelen);
+ memcpy (buf + 2, name, namelen);
bcopy (buf, bptr (blkno), block_size);
record_global_poke (bptr (blkno));
@@ -772,7 +772,7 @@ write_symlink (struct node *node, const char *target)
assert (node->dn_stat.st_blocks == 0);
- bcopy (target, node->dn->info.i_data, len);
+ memcpy (node->dn->info.i_data, target, len);
node->dn_stat.st_size = len - 1;
node->dn_set_ctime = 1;
node->dn_set_mtime = 1;
@@ -789,7 +789,7 @@ read_symlink (struct node *node, char *target)
assert (node->dn_stat.st_size < MAX_INODE_SYMLINK);
- bcopy (node->dn->info.i_data, target, node->dn_stat.st_size);
+ memcpy (target, node->dn->info.i_data, node->dn_stat.st_size);
return 0;
}