mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.5 KiB

  1. copied from debian... thanks!
  2. --- ./fdisk/cfdisk.c 2004-12-24 14:41:20.000000000 -0700
  3. +++ ./fdisk/cfdisk.c 2004-12-24 15:00:00.503453740 -0700
  4. @@ -2100,7 +2100,7 @@
  5. if (to_file) {
  6. if ((fp = fopen(fname, "w")) == NULL) {
  7. char errstr[LINE_LENGTH];
  8. - sprintf(errstr, _("Cannot open file '%s'"), fname);
  9. + snprintf(errstr, sizeof(errstr), _("Cannot open file '%s'"), fname);
  10. print_warning(errstr);
  11. return;
  12. }
  13. @@ -2184,7 +2184,7 @@
  14. if (to_file) {
  15. if ((fp = fopen(fname, "w")) == NULL) {
  16. char errstr[LINE_LENGTH];
  17. - sprintf(errstr, _("Cannot open file '%s'"), fname);
  18. + snprintf(errstr, sizeof(errstr), _("Cannot open file '%s'"), fname);
  19. print_warning(errstr);
  20. return;
  21. }
  22. @@ -2638,9 +2638,9 @@
  23. mvaddstr(WARNING_START, 0, line);
  24. - sprintf(line, "cfdisk %s", VERSION);
  25. + snprintf(line, COLS+1, "cfdisk %s", VERSION);
  26. mvaddstr(HEADER_START, (COLS-strlen(line))/2, line);
  27. - sprintf(line, _("Disk Drive: %s"), disk_device);
  28. + snprintf(line, COLS+1, _("Disk Drive: %s"), disk_device);
  29. mvaddstr(HEADER_START+2, (COLS-strlen(line))/2, line);
  30. {
  31. long long bytes = actual_size*(long long) SECTOR_SIZE;
  32. @@ -2654,7 +2654,7 @@
  33. bytes, megabytes/K, (10*megabytes/K)%10);
  34. }
  35. mvaddstr(HEADER_START+3, (COLS-strlen(line))/2, line);
  36. - sprintf(line, _("Heads: %d Sectors per Track: %d Cylinders: %lld"),
  37. + snprintf(line, COLS+1, _("Heads: %d Sectors per Track: %d Cylinders: %lld"),
  38. heads, sectors, cylinders);
  39. mvaddstr(HEADER_START+4, (COLS-strlen(line))/2, line);