mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 06:58:30 +00:00
Remove some use of C runtime functions (strlen, qsort)
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user