Explorar o código

KMSDRM: fix inverted strcmp, remove useless if test (Bug 4624)

Sylvain Becker %!s(int64=6) %!d(string=hai) anos
pai
achega
faed7f836d
Modificáronse 1 ficheiros con 2 adicións e 5 borrados
  1. 2 5
      src/video/kmsdrm/SDL_kmsdrmvideo.c

+ 2 - 5
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++;
             }
         }