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

This commit is contained in:
Sylvain
2023-06-23 10:31:40 +02:00
committed by Sylvain Becker
parent a807b14957
commit 6cde3835f0
2 changed files with 2 additions and 2 deletions

View File

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

View File

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