mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +00:00
(libretro-db) Cleanup - use strlcpy
This commit is contained in:
parent
726c000981
commit
1c82cce435
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "rmsgpack_dom.h"
|
#include "rmsgpack_dom.h"
|
||||||
#include <compat/fnmatch.h>
|
#include <compat/fnmatch.h>
|
||||||
|
#include <compat/strl.h>
|
||||||
|
|
||||||
#define MAX_ERROR_LEN 256
|
#define MAX_ERROR_LEN 256
|
||||||
#undef MAX_ARGS
|
#undef MAX_ARGS
|
||||||
@ -29,8 +30,8 @@ struct buffer
|
|||||||
/* Errors */
|
/* Errors */
|
||||||
static void raise_too_many_arguments(const char **error)
|
static void raise_too_many_arguments(const char **error)
|
||||||
{
|
{
|
||||||
snprintf(tmp_error_buff, MAX_ERROR_LEN,
|
strlcpy(tmp_error_buff,
|
||||||
"Too many arguments in function call.");
|
"Too many arguments in function call.", sizeof(tmp_error_buff));
|
||||||
*error = tmp_error_buff;
|
*error = tmp_error_buff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +74,7 @@ static void raise_unexpected_eof(off_t where, const char ** error)
|
|||||||
|
|
||||||
static void raise_enomem(const char **error)
|
static void raise_enomem(const char **error)
|
||||||
{
|
{
|
||||||
snprintf(tmp_error_buff, MAX_ERROR_LEN, "Out of memory");
|
strlcpy(tmp_error_buff, "Out of memory", sizeof(tmp_error_buff));
|
||||||
*error = tmp_error_buff;
|
*error = tmp_error_buff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user