aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-filesystem.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-filesystem.c
parent49e0f3e6466db78fb6c12f71e0c46be4b1492d90 (diff)
downloadbtrfs-progs-4e01c34b8bf06268a515b7ffe83e905b0a02ef38.tar.gz
btrfs-progs-4e01c34b8bf06268a515b7ffe83e905b0a02ef38.tar.xz
btrfs-progs-4e01c34b8bf06268a515b7ffe83e905b0a02ef38.zip
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-filesystem.c')
-rw-r--r--cmds-filesystem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 98c13f5..3bd6304 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -233,7 +233,7 @@ static int match_search_item_kernel(__u8 *fsid, char *mnt, char *label,
if (!strncmp(uuidbuf, search, search_len))
return 1;
- if (strlen(label) && strcmp(label, search) == 0)
+ if (*label && strcmp(label, search) == 0)
return 1;
if (strcmp(mnt, search) == 0)
@@ -403,7 +403,7 @@ static int print_one_fs(struct btrfs_ioctl_fs_info_args *fs_info,
return ret;
uuid_unparse(fs_info->fsid, uuidbuf);
- if (label && strlen(label))
+ if (label && *label)
printf("Label: '%s' ", label);
else
printf("Label: none ");
@@ -823,7 +823,7 @@ static int cmd_filesystem_show(int argc, char **argv)
if (argc > optind) {
search = argv[optind];
- if (strlen(search) == 0)
+ if (*search == 0)
usage(cmd_filesystem_show_usage);
type = check_arg_type(search);