Minor improvements to the performance-test tool

This commit is contained in:
flobernd 2017-09-25 17:06:14 +02:00
parent 505224dc20
commit 10a9765585
2 changed files with 6 additions and 5 deletions

View File

@ -360,14 +360,15 @@ int main(int argc, char** argv)
{
FILE* file;
char buf[256];
strcpy(&buf[0], directory);
size_t len = strlen(directory);
char buf[1024];
strncpy(&buf[0], directory, sizeof(buf) - 1);
if (generate)
{
file = fopen(strcat(buf, tests[i].filename), "wb");
file = fopen(strncat(buf, tests[i].filename, sizeof(buf) - len - 1), "wb");
} else
{
file = fopen(strcat(buf, tests[i].filename), "rb");
file = fopen(strncat(buf, tests[i].filename, sizeof(buf) - len - 1), "rb");
}
if (!file)
{

View File

@ -2326,7 +2326,7 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
(const ZydisInstructionDefinitionEVEX*)definition;
// Vector length
uint8_t vectorLength = vectorLength = context->cache.LL;;
uint8_t vectorLength = context->cache.LL;
if (def->vectorLength)
{
vectorLength = def->vectorLength - 1;