summaryrefslogtreecommitdiff
path: root/fdisk
diff options
context:
space:
mode:
Diffstat (limited to 'fdisk')
-rw-r--r--fdisk/cfdisk.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index 848a1013..4fb5a40f 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -113,8 +113,8 @@
#define DEFAULT_DEVICE "/dev/ad0"
#define ALTERNATE_DEVICE "/dev/da0"
#elif defined(__sun__)
-#define DEFAULT_DEVICE "/dev/rdsk/c0d0"
-#define ALTERNATE_DEVICE "/dev/rdsk/c0t0d0"
+#define DEFAULT_DEVICE "/dev/rdsk/c0d0p0"
+#define ALTERNATE_DEVICE "/dev/rdsk/c0t0d0p0"
#else
#define DEFAULT_DEVICE "/dev/hda"
#define ALTERNATE_DEVICE "/dev/sda"
@@ -2461,11 +2461,13 @@ draw_partition(int i) {
int l = strlen(dbn);
#ifdef __sun__
- /* XXX: Whole disk is c0t0d0p0, but patitions are c0t0d0p1, c0t0d0p2, etc */
- dbn[l-1] = '\0'; /* Cutoff '0' */
- mvprintw(y, NAME_START,
- "%s%d", dbn, p_info[i].num+1);
- dbn[l-1] = '0'; /* Restore '0' */
+ /*
+ * XXX: Whole disk is c0t0d0p0, but patitions are c0t0d0p1, c0t0d0p2, etc.
+ * disk_device (and dbn) could be read-only, so we just overwrite the last 0
+ * on the screen
+ */
+ mvprintw(y, NAME_START, "%s", dbn);
+ mvprintw(y, NAME_START+l-1, "%d", p_info[i].num+1);
#else
int digit_last = isdigit(dbn[l-1]);
mvprintw(y, NAME_START,