]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
misc/tune2fs: fix setting fsuuid::fsu_len
authorEric Biggers <ebiggers@google.com>
Sat, 21 Jan 2023 20:32:26 +0000 (12:32 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 27 Jan 2023 17:48:15 +0000 (12:48 -0500)
Minus does not mean equals.

Besides fixing an obvious bug, this avoids the following compiler
warning with clang -Wall:

tune2fs.c:3625:20: warning: expression result unused [-Wunused-value]
                        fsuuid->fsu_len - UUID_SIZE;
                        ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~

Fixes: a83e199da0ca ("tune2fs: Add support for get/set UUID ioctls.")
Reviewed-by: Jeremy Bongio <bongiojp@gmail.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c

index 5fe22e6a583a386cf7823e4d2842093e1570797c..2f7d9f3cb0e9fd250aa259871c34b4de5c89bee1 100644 (file)
@@ -3627,7 +3627,7 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
                ret = -1;
 #ifdef __linux__
                if (fsuuid) {
-                       fsuuid->fsu_len - UUID_SIZE;
+                       fsuuid->fsu_len = UUID_SIZE;
                        fsuuid->fsu_flags = 0;
                        memcpy(&fsuuid->fsu_uuid, new_uuid, UUID_SIZE);
                        ret = ioctl(fd, EXT4_IOC_SETFSUUID, fsuuid);