1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

updated fuzz tests to use FileNamesTable* abstraction

This commit is contained in:
Yann Collet
2019-11-06 14:42:13 -08:00
parent 31a0abbfda
commit a7e33e3e10
5 changed files with 46 additions and 52 deletions

View File

@ -642,6 +642,15 @@ void UTIL_expandFNT(FileNamesTable** fnt, int followLinks)
*fnt = newFNT;
}
FileNamesTable* UTIL_createFNT_fromROTable(const char** filenames, size_t nbFilenames)
{
size_t const sizeof_FNTable = nbFilenames * sizeof(*filenames);
const char** const newFNTable = (const char**)malloc(sizeof_FNTable);
if (newFNTable==NULL) return NULL;
memcpy(newFNTable, filenames, sizeof_FNTable);
return UTIL_createFileNamesTable(newFNTable, nbFilenames, NULL);
}
/*-****************************************
* count the number of physical cores