Replace more usage of strcpy

This commit is contained in:
twinaphex 2015-09-19 03:50:35 +02:00
parent 077fb3d32d
commit 43da185d5d
3 changed files with 8 additions and 4 deletions

View File

@ -158,7 +158,7 @@ static INLINE void rarch_fail(int error_code, const char *error)
* just exit right away. */
rarch_assert(global->inited.error);
strcpy(global->error_string, error);
strlcpy(global->error_string, error, sizeof(global->error_string));
longjmp(global->error_sjlj_context, error_code);
}

View File

@ -18,9 +18,13 @@
#include <string.h>
#include <string>
#include <vector>
#include <retro_inline.h>
#include <Cg/cg.h>
#include <Cg/cgD3D9.h>
#include <retro_inline.h>
#include <compat/strl.h>
#include "render_chain_driver.h"
#include "../video_driver.h"
#include "../../general.h"
@ -1166,7 +1170,7 @@ static bool cg_d3d9_renderchain_add_lut(void *data,
info.tex = lut;
info.smooth = smooth;
strcpy(info.id, id);
strlcpy(info.id, id, sizeof(info.id));
if (!lut)
return false;

View File

@ -175,7 +175,7 @@ struct http_connection_t *net_http_connection_new(const char *url)
if (!conn->urlcopy)
goto error;
strcpy(conn->urlcopy, url);
strlcpy(conn->urlcopy, url, sizeof(conn->urlcopy));
if (strncmp(url, "http://", strlen("http://")) != 0)
goto error;