mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +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);
|
||||
s->msg = (char*)malloc(strlen(s->path) + strlen(m) + 3);
|
||||
strlcpy(s->msg, s->path, sizeof(s->msg));
|
||||
strcat(s->msg, ": ");
|
||||
strcat(s->msg, m);
|
||||
strlcat(s->msg, ": ", sizeof(s->msg));
|
||||
strlcat(s->msg, m, sizeof(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 <elf/elf.h>
|
||||
#include <dirent.h>
|
||||
#include "../compat/strl.h"
|
||||
|
||||
#undef main
|
||||
|
||||
@ -100,8 +101,8 @@ static void append_dir_to_path(char *path, const char *dir)
|
||||
return;
|
||||
else
|
||||
{
|
||||
strcat(path, dir);
|
||||
strcat(path, "/");
|
||||
strlcat(path, dir, sizeof(path));
|
||||
strlcat(path, "/", sizeof(path));
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +129,7 @@ int main(void)
|
||||
return 0;
|
||||
|
||||
strlcpy(path, s, sizeof(path));
|
||||
strcat(path, ":/");
|
||||
strlcat(path, ":/", sizeof(path));
|
||||
|
||||
load_dir(path);
|
||||
|
||||
@ -164,7 +165,7 @@ int main(void)
|
||||
{
|
||||
char fn[256];
|
||||
strlcpy(fn, path, sizeof(fn));
|
||||
strcat(fn, entries[pos].d_name);
|
||||
strlcat(fn, entries[pos].d_name, sizeof(fn));
|
||||
|
||||
printf("%s\n", fn);
|
||||
|
||||
@ -188,7 +189,7 @@ int main(void)
|
||||
} while (handle < 0);
|
||||
|
||||
strlcpy(path, s, sizeof(path));
|
||||
strcat(path, ":/");
|
||||
strlcat(path, ":/", sizeof(path));
|
||||
load_dir(path);
|
||||
ppos = -1;
|
||||
pos = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user