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; FILE* file;
char buf[256]; size_t len = strlen(directory);
strcpy(&buf[0], directory); char buf[1024];
strncpy(&buf[0], directory, sizeof(buf) - 1);
if (generate) if (generate)
{ {
file = fopen(strcat(buf, tests[i].filename), "wb"); file = fopen(strncat(buf, tests[i].filename, sizeof(buf) - len - 1), "wb");
} else } else
{ {
file = fopen(strcat(buf, tests[i].filename), "rb"); file = fopen(strncat(buf, tests[i].filename, sizeof(buf) - len - 1), "rb");
} }
if (!file) if (!file)
{ {

View File

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