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

Function get_next_sector

src/pnext.h:61–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59inline
60#endif
61void get_next_sector(const alloc_data_t *list_search_space, alloc_data_t **current_search_space, uint64_t *offset, const unsigned int blocksize)
62{
63#ifdef DEBUG_GET_NEXT_SECTOR
64 log_debug(" get_next_sector %llu (%llu-%llu)\n",
65 (unsigned long long)((*offset)/512),
66 (unsigned long long)((*current_search_space)->start/512),
67 (unsigned long long)((*current_search_space)->end)/512);
68#endif
69 if((*current_search_space) == list_search_space)
70 {
71 return ;
72 }
73#ifdef DEBUG_GET_NEXT_SECTOR
74 if(! ((*current_search_space)->start <= *offset && (*offset)<=(*current_search_space)->end))
75 {
76 log_critical("BUG: get_next_sector stop everything %llu (%llu-%llu)\n",
77 (unsigned long long)((*offset)/512),
78 (unsigned long long)((*current_search_space)->start/512),
79 (unsigned long long)((*current_search_space)->end/512));
80 log_flush();
81 log_close();
82 exit(1);
83 }
84#endif
85 if((*offset)+blocksize <= (*current_search_space)->end)
86 *offset+=blocksize;
87 else
88 get_next_header(list_search_space, current_search_space, offset);
89}
90
91/*@
92 @ requires \valid_read(list_search_space);

Callers 9

photorec_bfFunction · 0.85
photorec_bf_padFunction · 0.85
photorec_bf_frag_fastFunction · 0.85
photorec_bf_fragFunction · 0.85
photorec_find_blocksizeFunction · 0.85
photorec_auxFunction · 0.85
photorec_auxMethod · 0.85

Calls 3

log_flushFunction · 0.85
log_closeFunction · 0.85
get_next_headerFunction · 0.85

Tested by

no test coverage detected