From faed7f836d0ac9d93c376a9cb87da7e8212ca219 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Wed, 19 Jun 2019 10:11:38 +0200 Subject: [PATCH] KMSDRM: fix inverted strcmp, remove useless if test (Bug 4624) --- src/video/kmsdrm/SDL_kmsdrmvideo.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index b1a18acac..b753542b7 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -101,11 +101,8 @@ static int get_dricount(void) folder = opendir(KMSDRM_DRI_PATH); if (folder) { while ((res = readdir(folder))) { - int len = 0; - if (res->d_name) { - len = SDL_strlen(res->d_name); - } - if (len > 4 && strncmp(res->d_name, "card", 4)) { + int len = SDL_strlen(res->d_name); + if (len > 4 && strncmp(res->d_name, "card", 4) == 0) { devcount++; } }