KMSDRM: fix inverted strcmp, remove useless if test (Bug 4624)
authorSylvain Becker <sylvain.becker@gmail.com>
Wed, 19 Jun 2019 10:11:38 +0200
changeset 12891df4fda4ec707
parent 12890 dd47d4ea431e
child 12892 d171cb5b389d
KMSDRM: fix inverted strcmp, remove useless if test (Bug 4624)
src/video/kmsdrm/SDL_kmsdrmvideo.c
     1.1 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c	Wed Jun 19 09:16:53 2019 +0200
     1.2 +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c	Wed Jun 19 10:11:38 2019 +0200
     1.3 @@ -101,11 +101,8 @@
     1.4      folder = opendir(KMSDRM_DRI_PATH);
     1.5      if (folder) {
     1.6          while ((res = readdir(folder))) {
     1.7 -            int len = 0;
     1.8 -            if (res->d_name) {
     1.9 -                len = SDL_strlen(res->d_name);
    1.10 -            }
    1.11 -            if (len > 4 && strncmp(res->d_name, "card", 4)) {
    1.12 +            int len = SDL_strlen(res->d_name);
    1.13 +            if (len > 4 && strncmp(res->d_name, "card", 4) == 0) {
    1.14                  devcount++;
    1.15              }
    1.16          }