mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 15:08:31 +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;
|
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;
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user