Magellan Linux

Annotation of /trunk/util-linux/patches/util-linux-2.12q-debian-10cfdisk.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (hide annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years, 1 month ago) by niro
File size: 1888 byte(s)
-import

1 niro 153 #! /bin/sh /usr/share/dpatch/dpatch-run
2     ## 10cfdisk.dpatch by LaMont Jones <lamont@debian.org>
3     ##
4     ## All lines beginning with `## DP:' are a description of the patch.
5     ## DP: Buffer overruns with narrow terminal windows.
6    
7     @DPATCH@
8     diff -urNad util-linux/fdisk/cfdisk.c /tmp/dpep.rEB26p/util-linux/fdisk/cfdisk.c
9     --- util-linux/fdisk/cfdisk.c 2004-12-24 14:41:20.000000000 -0700
10     +++ /tmp/dpep.rEB26p/util-linux/fdisk/cfdisk.c 2004-12-24 15:00:00.503453740 -0700
11     @@ -2100,7 +2100,7 @@
12     if (to_file) {
13     if ((fp = fopen(fname, "w")) == NULL) {
14     char errstr[LINE_LENGTH];
15     - sprintf(errstr, _("Cannot open file '%s'"), fname);
16     + snprintf(errstr, sizeof(errstr), _("Cannot open file '%s'"), fname);
17     print_warning(errstr);
18     return;
19     }
20     @@ -2184,7 +2184,7 @@
21     if (to_file) {
22     if ((fp = fopen(fname, "w")) == NULL) {
23     char errstr[LINE_LENGTH];
24     - sprintf(errstr, _("Cannot open file '%s'"), fname);
25     + snprintf(errstr, sizeof(errstr), _("Cannot open file '%s'"), fname);
26     print_warning(errstr);
27     return;
28     }
29     @@ -2638,9 +2638,9 @@
30     mvaddstr(WARNING_START, 0, line);
31    
32    
33     - sprintf(line, "cfdisk %s", VERSION);
34     + snprintf(line, COLS+1, "cfdisk %s", VERSION);
35     mvaddstr(HEADER_START, (COLS-strlen(line))/2, line);
36     - sprintf(line, _("Disk Drive: %s"), disk_device);
37     + snprintf(line, COLS+1, _("Disk Drive: %s"), disk_device);
38     mvaddstr(HEADER_START+2, (COLS-strlen(line))/2, line);
39     {
40     long long bytes = actual_size*(long long) SECTOR_SIZE;
41     @@ -2654,7 +2654,7 @@
42     bytes, megabytes/K, (10*megabytes/K)%10);
43     }
44     mvaddstr(HEADER_START+3, (COLS-strlen(line))/2, line);
45     - sprintf(line, _("Heads: %d Sectors per Track: %d Cylinders: %lld"),
46     + snprintf(line, COLS+1, _("Heads: %d Sectors per Track: %d Cylinders: %lld"),
47     heads, sectors, cylinders);
48     mvaddstr(HEADER_START+4, (COLS-strlen(line))/2, line);
49