diff options
author | Maksym Planeta <mcsim.planeta@gmail.com> | 2012-10-06 19:25:07 +0300 |
---|---|---|
committer | Maksym Planeta <mcsim.planeta@gmail.com> | 2012-10-07 21:30:47 +0300 |
commit | e42a8397287e27f23cf9286e9e1976d77bd7625d (patch) | |
tree | 2b80ec429e0677f84411a88d26246d4d44774a19 | |
parent | 511174a00d4d174a221947eb6c361de551035178 (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.c | 2 | ||||
-rw-r--r-- | ext2fs/getblk.c | 2 | ||||
-rw-r--r-- | ext2fs/inode.c | 6 |
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; } |