1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 19:01:15 +01:00

revent: Fixed magic check

A null character was not being added to the end of the string.
This commit is contained in:
Sebastian Goscik 2016-07-21 15:14:11 +01:00
parent 25eac432c9
commit 54c409ce6f
3 changed files with 2 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -251,6 +251,7 @@ void dump(const char *logfile)
//Read magic
len = strlen(magic);
size_t rb = read(fdin, &buf[0], len);
buf[len] = '\0';
if (rb != len) die("problems reading eventlog\n");
if(strcmp(magic, buf) != 0)
die("File is not an revent recording, are you using an old recording?");
@ -317,6 +318,7 @@ int replay_buffer_init(replay_buffer_t **buffer, const char *logfile)
char buf[7];
len = strlen(magic);
size_t rb = read(fdin, &buf[0], len);
buf[len] = '\0';
if (rb != len) die("problems reading eventlog\n");
if(strcmp(magic, buf) != 0)
die("File is not an revent recording, are you using an old recording?");