diff options
Diffstat (limited to 'debian/patches/upstream/0011-sfdisk-improve-code-readability-for-coverity-scan.patch')
-rw-r--r-- | debian/patches/upstream/0011-sfdisk-improve-code-readability-for-coverity-scan.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/debian/patches/upstream/0011-sfdisk-improve-code-readability-for-coverity-scan.patch b/debian/patches/upstream/0011-sfdisk-improve-code-readability-for-coverity-scan.patch new file mode 100644 index 0000000..dc707cb --- /dev/null +++ b/debian/patches/upstream/0011-sfdisk-improve-code-readability-for-coverity-scan.patch @@ -0,0 +1,40 @@ +From: Karel Zak <kzak@redhat.com> +Date: Thu, 11 Aug 2022 13:04:58 +0200 +Subject: [PATCH 11/24] sfdisk: improve code readability for coverity scan + +Signed-off-by: Karel Zak <kzak@redhat.com> +--- + disk-utils/sfdisk.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c +index 38c7b17..112bc7c 100644 +--- a/disk-utils/sfdisk.c ++++ b/disk-utils/sfdisk.c +@@ -435,7 +435,6 @@ static int move_partition_data(struct sfdisk *sf, size_t partno, struct fdisk_pa + from = fdisk_partition_get_start(orig_pa); + to = fdisk_partition_get_start(pa); + +- + if ((to >= from && from + nsectors >= to) || + (from >= to && to + nsectors >= from)) { + /* source and target overlay, check if we need to copy +@@ -462,7 +461,8 @@ static int move_partition_data(struct sfdisk *sf, size_t partno, struct fdisk_pa + + #if defined(POSIX_FADV_SEQUENTIAL) && defined(HAVE_POSIX_FADVISE) + if (!backward) +- posix_fadvise(fd, from * ss, nsectors * ss, POSIX_FADV_SEQUENTIAL); ++ ignore_result( posix_fadvise(fd, from * ss, ++ nsectors * ss, POSIX_FADV_SEQUENTIAL) ); + #endif + devname = fdisk_partname(fdisk_get_devname(sf->cxt), partno+1); + if (sf->move_typescript) +@@ -608,7 +608,7 @@ next: + src += step_bytes, dst += step_bytes; + } + +- if (progress) { ++ if (progress && nsectors) { + int x = get_terminal_width(80); + for (; x > 0; x--) + fputc(' ', stdout); |