mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9166] Fixes/cleanups in extarctor code.
* Avoid create debug binary version with space in name, ignore it in git changes. * Alow filenum == 0 in archive file lists. Some currently not loaded fiels have its for example in case when in archive single file. NOTE: no change in extracted files, so not need re-execute.
This commit is contained in:
parent
23a77a1d36
commit
2d37ac049a
7 changed files with 30 additions and 38 deletions
|
|
@ -200,30 +200,16 @@ int libmpq_archive_info(mpq_archive *mpq_a, unsigned int infotype) {
|
|||
* This function returns some useful file information.
|
||||
*/
|
||||
int libmpq_file_info(mpq_archive *mpq_a, unsigned int infotype, const unsigned int number) {
|
||||
int blockindex = number; //-1;
|
||||
int blockindex = number;
|
||||
int i = 0;
|
||||
mpq_block *mpq_b = NULL;
|
||||
mpq_hash *mpq_h = NULL;
|
||||
|
||||
/* check if given number is not out of range */
|
||||
if (number < 1 || number > mpq_a->header->blocktablesize) {
|
||||
if (number < 0 || number >= mpq_a->header->blocktablesize) {
|
||||
return LIBMPQ_EINV_RANGE;
|
||||
}
|
||||
|
||||
/* search for correct hashtable */
|
||||
/*for (i = 0; i < mpq_a->header->hashtablesize; i++) {
|
||||
if ((number - 1) == (mpq_a->hashtable[i]).blockindex) {
|
||||
blockindex = (mpq_a->hashtable[i]).blockindex;
|
||||
mpq_h = &(mpq_a->hashtable[i]);
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
/* check if file was found */
|
||||
/*if (blockindex == -1 || blockindex > mpq_a->header->blocktablesize) {
|
||||
return LIBMPQ_EFILE_NOT_FOUND;
|
||||
}*/
|
||||
|
||||
/* check if sizes are correct */
|
||||
mpq_b = mpq_a->blocktable + blockindex;
|
||||
if (mpq_b->filepos > (mpq_a->header->archivesize + mpq_a->mpqpos) || mpq_b->csize > mpq_a->header->archivesize) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue