summaryrefslogtreecommitdiffstats
path: root/fdisk/fdisksunlabel.c
diff options
context:
space:
mode:
Diffstat (limited to 'fdisk/fdisksunlabel.c')
-rw-r--r--fdisk/fdisksunlabel.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fdisk/fdisksunlabel.c b/fdisk/fdisksunlabel.c
index f96cb0b15..2a36852a5 100644
--- a/fdisk/fdisksunlabel.c
+++ b/fdisk/fdisksunlabel.c
@@ -348,10 +348,11 @@ void create_sunlabel(void)
puts(_("You may change all the disk params from the x menu"));
}
- sprintf(sunlabel->info, "%s%s%s cyl %d alt %d hd %d sec %d",
- p ? p->vendor : "",
- (p && *p->vendor) ? " " : "",
- p ? p->model : (floppy ? _("3,5\" floppy") : _("Linux custom")),
+ snprintf(sunlabel->info, sizeof(sunlabel->info),
+ "%s%s%s cyl %d alt %d hd %d sec %d",
+ p ? p->vendor : "", (p && *p->vendor) ? " " : "",
+ p ? p->model
+ : (floppy ? _("3,5\" floppy") : _("Linux custom")),
cylinders, SSWAP16(sunlabel->nacyl), heads, sectors);
sunlabel->ntrks = SSWAP16(heads);
@@ -514,7 +515,7 @@ add_sun_partition(int n, int sys) {
return;
}
}
- sprintf(mesg, _("First %s"), str_units(SINGULAR));
+ snprintf(mesg, sizeof(mesg), _("First %s"), str_units(SINGULAR));
for (;;) {
if (whole_disk)
first = read_int(0, 0, 0, 0, mesg);
@@ -549,7 +550,9 @@ and is of type `Whole disk'\n");
if (starts[i] > first && starts[i] < stop)
stop = starts[i];
}
- sprintf(mesg, _("Last %s or +size or +sizeM or +sizeK"), str_units(SINGULAR));
+ snprintf(mesg, sizeof(mesg),
+ _("Last %s or +size or +sizeM or +sizeK"),
+ str_units(SINGULAR));
if (whole_disk)
last = read_int(scround(stop2), scround(stop2), scround(stop2),
0, mesg);