Display (Linux): fix the error check for ffReadFileData (#1622)

This commit is contained in:
apocelipes
2025-03-18 19:51:51 +08:00
committed by GitHub
parent ef5d12395b
commit d33b5d60b6
+1 -1
View File
@@ -30,7 +30,7 @@ static const char* drmParseSysfs(FFDisplayServerResult* result)
char buf;
ffStrbufAppendS(&drmDir, "/enabled");
if (!ffReadFileData(drmDir.chars, sizeof(buf), &buf) || buf != 'e') {
if (ffReadFileData(drmDir.chars, sizeof(buf), &buf) <= 0 || buf != 'e') {
/* read failed or enabled != "enabled" */
ffStrbufSubstrBefore(&drmDir, drmDirWithDnameLength);
ffStrbufAppendS(&drmDir, "/status");