[igt-dev] [PATCH i-g-t 1/2] runner: Check for strchr result in parse_dmesg_line
Ryszard Knop
ryszard.knop at intel.com
Wed Aug 10 13:44:52 UTC 2022
The intent here most likely was that if strchr returns NULL, the error
below is printed out, but the condition was to check if the provided
buffer was not NULL.
Signed-off-by: Ryszard Knop <ryszard.knop at intel.com>
---
runner/resultgen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 6ecf325b..38d90bda 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -864,7 +864,7 @@ static bool parse_dmesg_line(char* line,
}
*message = strchr(line, ';');
- if (!message) {
+ if (*message == NULL) {
fprintf(stderr, "No ; found in kmsg record, this shouldn't happen\n");
return false;
}
--
2.37.1
More information about the igt-dev
mailing list