Skip to content

Commit

Permalink
KMSDRM: fix compilation on linux, no d_namlen (Bug 4624)
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Jun 19, 2019
1 parent d0fa93d commit 5998c51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video/kmsdrm/SDL_kmsdrmvideo.c
Expand Up @@ -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++;
}
}
Expand Down

0 comments on commit 5998c51

Please sign in to comment.