Modify the file name length limit to meet the Linux naming convention. 
In addition, the file name length is always bigger than 0, no need to 
compare with 0 again.

Issue: #145
Signed-off-by: Su Yanjun <suyj.f...@cn.fujitsu.com>
---
 cmds-subvolume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index e7a884af..fe97fca3 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -715,7 +715,7 @@ static int cmd_subvol_snapshot(int argc, char **argv)
        }
 
        len = strlen(newname);
-       if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
+       if (len > BTRFS_VOL_NAME_MAX) {
                error("snapshot name too long '%s'", newname);
                goto out;
        }
-- 
2.18.0



Reply via email to