mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-07-16 03:53:30 +01:00
revent: Fixed magic check
A null character was not being added to the end of the string.
This commit is contained in:
Binary file not shown.
Binary file not shown.
2
wlauto/external/revent/revent.c
vendored
2
wlauto/external/revent/revent.c
vendored
@ -251,6 +251,7 @@ void dump(const char *logfile)
|
|||||||
//Read magic
|
//Read magic
|
||||||
len = strlen(magic);
|
len = strlen(magic);
|
||||||
size_t rb = read(fdin, &buf[0], len);
|
size_t rb = read(fdin, &buf[0], len);
|
||||||
|
buf[len] = '\0';
|
||||||
if (rb != len) die("problems reading eventlog\n");
|
if (rb != len) die("problems reading eventlog\n");
|
||||||
if(strcmp(magic, buf) != 0)
|
if(strcmp(magic, buf) != 0)
|
||||||
die("File is not an revent recording, are you using an old recording?");
|
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];
|
char buf[7];
|
||||||
len = strlen(magic);
|
len = strlen(magic);
|
||||||
size_t rb = read(fdin, &buf[0], len);
|
size_t rb = read(fdin, &buf[0], len);
|
||||||
|
buf[len] = '\0';
|
||||||
if (rb != len) die("problems reading eventlog\n");
|
if (rb != len) die("problems reading eventlog\n");
|
||||||
if(strcmp(magic, buf) != 0)
|
if(strcmp(magic, buf) != 0)
|
||||||
die("File is not an revent recording, are you using an old recording?");
|
die("File is not an revent recording, are you using an old recording?");
|
||||||
|
Reference in New Issue
Block a user