Whamcloud - gitweb
LU-9934 build: address issues raised by gcc7
[fs/lustre-release.git] / lustre / utils / lsnapshot.c
index 3221f74..4b10836 100644 (file)
@@ -1325,8 +1325,7 @@ static int snapshot_create(struct snapshot_instance *si)
                return rc;
 
        srandom(tv.tv_usec);
-       snprintf(new_fsname, 8, "%08x", (__u32)random());
-       new_fsname[8] = '\0';
+       snprintf(new_fsname, sizeof(new_fsname), "%08x", (__u32)random());
 
        rc = snapshot_get_mgsnode(si, buf, sizeof(buf));
        if (rc)