Explorar el Código

KMSDRM: fix compilation on linux, no d_namlen (Bug 4624)

Sylvain Becker hace 5 años
padre
commit
5998c51324
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/video/kmsdrm/SDL_kmsdrmvideo.c

+ 5 - 1
src/video/kmsdrm/SDL_kmsdrmvideo.c

@@ -101,7 +101,11 @@ static int get_dricount(void)
     folder = opendir(KMSDRM_DRI_PATH);
     if (folder) {
         while ((res = readdir(folder))) {
-            if (res->d_namlen > 4 && strncmp(res->d_name, "card", 4)) {
+            int len = 0;
+            if (res->d_name) {
+                len = SDL_strlen(res->d_name);
+            }
+            if (len > 4 && strncmp(res->d_name, "card", 4)) {
                 devcount++;
             }
         }