summaryrefslogtreecommitdiff
path: root/cmds-receive.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2015-11-06 16:53:55 +0100
committerDavid Sterba <dsterba@suse.com>2015-11-06 16:53:55 +0100
commit4e01c34b8bf06268a515b7ffe83e905b0a02ef38 (patch)
tree391f12e7fcab1172ef3326579d27c39e4b77b3de /cmds-receive.c
parent49e0f3e6466db78fb6c12f71e0c46be4b1492d90 (diff)
btrfs-progs: simplify empty stirngs check
We can do a strlen(str) == 0 in a simpler way. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-receive.c')
-rw-r--r--cmds-receive.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmds-receive.c b/cmds-receive.c
index 1d7d897f..3a84a3bf 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -169,7 +169,7 @@ static int process_subvol(const char *path, const u8 *uuid, u64 ctransid,
BUG_ON(r->cur_subvol.path);
BUG_ON(r->cur_subvol_path[0]);
- if (strlen(r->dest_dir_path) == 0) {
+ if (*r->dest_dir_path == 0) {
strncpy_null(r->cur_subvol_path, path);
} else {
ret = path_cat_out(r->cur_subvol_path, r->dest_dir_path, path);
@@ -229,7 +229,7 @@ static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid,
BUG_ON(r->cur_subvol.path);
BUG_ON(r->cur_subvol_path[0]);
- if (strlen(r->dest_dir_path) == 0) {
+ if (*r->dest_dir_path == 0) {
strncpy_null(r->cur_subvol_path, path);
} else {
ret = path_cat_out(r->cur_subvol_path, r->dest_dir_path, path);
@@ -326,7 +326,7 @@ static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid,
}
}*/
- if (strlen(parent_subvol->path) == 0)
+ if (*parent_subvol->path == 0)
args_v2.fd = dup(r->mnt_fd);
else
args_v2.fd = openat(r->mnt_fd, parent_subvol->path,
@@ -1135,7 +1135,7 @@ static int do_receive(struct btrfs_receive *r, const char *tomnt,
* Ok we're inside of a subvol off of the root subvol, we need to
* actually set full_root_path.
*/
- if (strlen(root_subvol_path))
+ if (*root_subvol_path)
r->full_root_path = root_subvol_path;
if (r->dest_dir_chroot) {