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

Function adv_menu_image_selected

src/adv.c:365–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365static void adv_menu_image_selected(disk_t *disk, const partition_t *partition, char **current_cmd)
366{
367 char dst_path[4096];
368 dst_path[0]='\0';
369#ifdef HAVE_NCURSES
370 if(*current_cmd!=NULL)
371 td_getcwd(dst_path, sizeof(dst_path));
372 else
373 {
374 char msg[256];
375 snprintf(msg, sizeof(msg),
376 "Please select where to store the file image.dd (%u MB), an image of the partition",
377 (unsigned int)(partition->part_size/1000/1000));
378 ask_location(dst_path, sizeof(dst_path), msg, "");
379 }
380#else
381 td_getcwd(&dst_path, sizeof(dst_path));
382#endif
383 if(dst_path[0]!='\0')
384 {
385 char *filename=(char *)MALLOC(strlen(dst_path) + 1 + strlen(DEFAULT_IMAGE_NAME) + 1);
386 strcpy(filename, dst_path);
387 strcat(filename, "/");
388 strcat(filename, DEFAULT_IMAGE_NAME);
389 disk_image(disk, partition, filename);
390 free(filename);
391 }
392}
393
394static void adv_menu_undelete_selected(disk_t *disk, const partition_t *partition, const int verbose, char **current_cmd)
395{

Callers 1

interface_advFunction · 0.85

Calls 4

td_getcwdFunction · 0.85
snprintfFunction · 0.85
MALLOCFunction · 0.85
disk_imageFunction · 0.85

Tested by

no test coverage detected