summaryrefslogtreecommitdiffstats
path: root/fdisk/cfdisk.c
diff options
context:
space:
mode:
authorKarel Zak2010-08-09 11:32:46 +0200
committerKarel Zak2010-08-09 11:32:46 +0200
commit3d9440ee18f27ed3412d3337c042834138c5b523 (patch)
tree0546c1b729487b87a93d257ff58e135a7c37379b /fdisk/cfdisk.c
parentdocs: mark line(1) as deprecated (diff)
downloadkernel-qcow2-util-linux-3d9440ee18f27ed3412d3337c042834138c5b523.tar.gz
kernel-qcow2-util-linux-3d9440ee18f27ed3412d3337c042834138c5b523.tar.xz
kernel-qcow2-util-linux-3d9440ee18f27ed3412d3337c042834138c5b523.zip
cfdisk: fix n+1 bug in error message
# cfdisk -Ps <devname> correctly uses 1..N range for partition numbers, unfortunately some error messages use 0..N. This is confusing. Reported-by: J B <jb.1234abcd@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisk/cfdisk.c')
-rw-r--r--fdisk/cfdisk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index e7955fe55..610b84718 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -1629,7 +1629,7 @@ fill_p_info(void) {
((bs <= sectors) ? bs : 0), 1, &errmsg)) {
char *bad = _("Bad primary partition");
char *msg = (char *) xmalloc(strlen(bad) + strlen(errmsg) + 30);
- sprintf(msg, "%s %d: %s", bad, i, errmsg);
+ sprintf(msg, "%s %d: %s", bad, i + 1, errmsg);
fatal(msg, 4);
}
if (is_extended(buffer.p.part[i].sys_ind))
@@ -1659,7 +1659,7 @@ fill_p_info(void) {
bs, 1, &errmsg)) {
char *bad = _("Bad logical partition");
char *msg = (char *) xmalloc(strlen(bad) + strlen(errmsg) + 30);
- sprintf(msg, "%s %d: %s", bad, i, errmsg);
+ sprintf(msg, "%s %d: %s", bad, i + 1, errmsg);
fatal(msg, 4);
}
}