@ -0,0 +1,42 @@ |
|||||
|
copied from debian... thanks! |
||||
|
--- ./fdisk/cfdisk.c 2004-12-24 14:41:20.000000000 -0700
|
||||
|
+++ ./fdisk/cfdisk.c 2004-12-24 15:00:00.503453740 -0700
|
||||
|
@@ -2100,7 +2100,7 @@
|
||||
|
if (to_file) { |
||||
|
if ((fp = fopen(fname, "w")) == NULL) { |
||||
|
char errstr[LINE_LENGTH]; |
||||
|
- sprintf(errstr, _("Cannot open file '%s'"), fname);
|
||||
|
+ snprintf(errstr, sizeof(errstr), _("Cannot open file '%s'"), fname);
|
||||
|
print_warning(errstr); |
||||
|
return; |
||||
|
} |
||||
|
@@ -2184,7 +2184,7 @@
|
||||
|
if (to_file) { |
||||
|
if ((fp = fopen(fname, "w")) == NULL) { |
||||
|
char errstr[LINE_LENGTH]; |
||||
|
- sprintf(errstr, _("Cannot open file '%s'"), fname);
|
||||
|
+ snprintf(errstr, sizeof(errstr), _("Cannot open file '%s'"), fname);
|
||||
|
print_warning(errstr); |
||||
|
return; |
||||
|
} |
||||
|
@@ -2638,9 +2638,9 @@
|
||||
|
mvaddstr(WARNING_START, 0, line); |
||||
|
|
||||
|
|
||||
|
- sprintf(line, "cfdisk %s", VERSION);
|
||||
|
+ snprintf(line, COLS+1, "cfdisk %s", VERSION);
|
||||
|
mvaddstr(HEADER_START, (COLS-strlen(line))/2, line); |
||||
|
- sprintf(line, _("Disk Drive: %s"), disk_device);
|
||||
|
+ snprintf(line, COLS+1, _("Disk Drive: %s"), disk_device);
|
||||
|
mvaddstr(HEADER_START+2, (COLS-strlen(line))/2, line); |
||||
|
{ |
||||
|
long long bytes = actual_size*(long long) SECTOR_SIZE; |
||||
|
@@ -2654,7 +2654,7 @@
|
||||
|
bytes, megabytes/K, (10*megabytes/K)%10); |
||||
|
} |
||||
|
mvaddstr(HEADER_START+3, (COLS-strlen(line))/2, line); |
||||
|
- sprintf(line, _("Heads: %d Sectors per Track: %d Cylinders: %lld"),
|
||||
|
+ snprintf(line, COLS+1, _("Heads: %d Sectors per Track: %d Cylinders: %lld"),
|
||||
|
heads, sectors, cylinders); |
||||
|
mvaddstr(HEADER_START+4, (COLS-strlen(line))/2, line); |
||||
|
|
||||