mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-28 10:40:39 +00:00
Prefer to use strlcpy instead of strcpy
This commit is contained in:
parent
490b3f5ed2
commit
cd0bf8f31a
@ -20,6 +20,7 @@
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
@ -377,7 +378,7 @@ static void drm_format_name(const unsigned int fourcc, char *format_str)
|
||||
for (i = 0; i < ARRAY_SIZE(format_info); i++)
|
||||
{
|
||||
if (format_info[i].format == fourcc)
|
||||
strcpy(format_str, format_info[i].name);
|
||||
strlcpy(format_str, format_info[i].name, sizeof(format_str));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include <sys/un.h>
|
||||
#include <poll.h>
|
||||
|
||||
#include <compat/strl.h>
|
||||
|
||||
#include <GL/osmesa.h>
|
||||
|
||||
#include "../../runloop.h"
|
||||
@ -73,7 +75,7 @@ static void osmesa_fifo_open(gfx_ctx_osmesa_data_t *osmesa)
|
||||
|
||||
saun.sun_family = AF_UNIX;
|
||||
|
||||
strcpy(saun.sun_path, g_osmesa_fifo);
|
||||
strlcpy(saun.sun_path, g_osmesa_fifo, sizeof(saun.sun_path));
|
||||
|
||||
unlink(g_osmesa_fifo);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user