mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Replace remaining strcats with strlcat
This commit is contained in:
parent
3e10f615bd
commit
69209b5e2e
@ -2076,8 +2076,8 @@ const char* gzerror (voidp file, int *errnum)
|
|||||||
free(s->msg);
|
free(s->msg);
|
||||||
s->msg = (char*)malloc(strlen(s->path) + strlen(m) + 3);
|
s->msg = (char*)malloc(strlen(s->path) + strlen(m) + 3);
|
||||||
strlcpy(s->msg, s->path, sizeof(s->msg));
|
strlcpy(s->msg, s->path, sizeof(s->msg));
|
||||||
strcat(s->msg, ": ");
|
strlcat(s->msg, ": ", sizeof(s->msg));
|
||||||
strcat(s->msg, m);
|
strlcat(s->msg, m, sizeof(s->msg));
|
||||||
return (const char*)s->msg;
|
return (const char*)s->msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
11
xenon/main.c
11
xenon/main.c
@ -31,6 +31,7 @@
|
|||||||
#include <xenon_soc/xenon_power.h>
|
#include <xenon_soc/xenon_power.h>
|
||||||
#include <elf/elf.h>
|
#include <elf/elf.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include "../compat/strl.h"
|
||||||
|
|
||||||
#undef main
|
#undef main
|
||||||
|
|
||||||
@ -100,8 +101,8 @@ static void append_dir_to_path(char *path, const char *dir)
|
|||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcat(path, dir);
|
strlcat(path, dir, sizeof(path));
|
||||||
strcat(path, "/");
|
strlcat(path, "/", sizeof(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +129,7 @@ int main(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
strlcpy(path, s, sizeof(path));
|
strlcpy(path, s, sizeof(path));
|
||||||
strcat(path, ":/");
|
strlcat(path, ":/", sizeof(path));
|
||||||
|
|
||||||
load_dir(path);
|
load_dir(path);
|
||||||
|
|
||||||
@ -164,7 +165,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
char fn[256];
|
char fn[256];
|
||||||
strlcpy(fn, path, sizeof(fn));
|
strlcpy(fn, path, sizeof(fn));
|
||||||
strcat(fn, entries[pos].d_name);
|
strlcat(fn, entries[pos].d_name, sizeof(fn));
|
||||||
|
|
||||||
printf("%s\n", fn);
|
printf("%s\n", fn);
|
||||||
|
|
||||||
@ -188,7 +189,7 @@ int main(void)
|
|||||||
} while (handle < 0);
|
} while (handle < 0);
|
||||||
|
|
||||||
strlcpy(path, s, sizeof(path));
|
strlcpy(path, s, sizeof(path));
|
||||||
strcat(path, ":/");
|
strlcat(path, ":/", sizeof(path));
|
||||||
load_dir(path);
|
load_dir(path);
|
||||||
ppos = -1;
|
ppos = -1;
|
||||||
pos = 0;
|
pos = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user