Browse Source

Remove some use of C runtime functions (strlen, qsort)

Sylvain 1 year ago
parent
commit
6cde3835f0
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/filesystem/unix/SDL_sysfilesystem.c
  2. 1 1
      src/joystick/linux/SDL_sysjoystick.c

+ 1 - 1
src/filesystem/unix/SDL_sysfilesystem.c

@@ -419,7 +419,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
       p += 4;
       if (SDL_strncmp (p, type, SDL_strlen (type)) != 0)
         continue;
-      p += strlen (type);
+      p += SDL_strlen (type);
       if (SDL_strncmp (p, "_DIR", 4) != 0)
         continue;
       p += 4;

+ 1 - 1
src/joystick/linux/SDL_sysjoystick.c

@@ -708,7 +708,7 @@ static void LINUX_FallbackJoystickDetect(void)
 
             count = scandir("/dev/input", &entries, filter_entries, NULL);
             if (count > 1) {
-                qsort(entries, count, sizeof(*entries), sort_entries);
+                SDL_qsort(entries, count, sizeof(*entries), sort_entries);
             }
             for (i = 0; i < count; ++i) {
                 (void)SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", entries[i]->d_name);