MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / write_clean_table

Function write_clean_table

src/tdelete.c:41–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39#define INTER_DISK_Y 7
40
41int write_clean_table(disk_t *disk_car)
42{
43 aff_copy(stdscr);
44 wmove(stdscr,5,0);
45 wprintw(stdscr,"%s\n",disk_car->description(disk_car));
46 wmove(stdscr,INTER_DISK_Y,INTER_DISK_X);
47 if(disk_car->arch->erase_list_part==NULL)
48 {
49 display_message("Partition table clearing is not implemented for this partition type.\n");
50 return 1;
51 }
52 wprintw(stdscr,msg_WRITE_CLEAN_TABLE);
53 if(ask_YN(stdscr)!=0 && ask_confirmation("Clear partition table, confirm ? (Y/N)")!=0)
54 {
55 if(disk_car->arch->erase_list_part(disk_car))
56 {
57 display_message("Write error: Can't clear partition table.\n");
58 return 2;
59 }
60 else
61 display_message("Partition table has been cleared.\nYou have to reboot for the change to take effect.\n");
62 }
63 return 0;
64}
65#else
66int write_clean_table(disk_t *disk_car)
67{

Callers 2

menu_disk_cliFunction · 0.85
menu_disk_ncursesFunction · 0.85

Calls 4

display_messageFunction · 0.85
ask_YNFunction · 0.85
ask_confirmationFunction · 0.85
aff_copyFunction · 0.70

Tested by

no test coverage detected