mirror of
https://github.com/libretro/RetroArch.git
synced 2024-10-08 15:13:24 +00:00
(rzlib) Avoid strcpy
This commit is contained in:
parent
b1e636a1ff
commit
8caea95a1d
4
deps/rzlib/gzlib.c
vendored
4
deps/rzlib/gzlib.c
vendored
@ -209,7 +209,7 @@ local gzFile gz_open(const void *path, int fd, const char *mode)
|
|||||||
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
|
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
|
||||||
snprintf(state->path, len + 1, "%s", (const char *)path);
|
snprintf(state->path, len + 1, "%s", (const char *)path);
|
||||||
#else
|
#else
|
||||||
strcpy(state->path, path);
|
strlcpy(state->path, path, sizeof(state->path));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* compute the flags for open() */
|
/* compute the flags for open() */
|
||||||
@ -575,7 +575,7 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
|
|||||||
snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
|
snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
|
||||||
"%s%s%s", state->path, ": ", msg);
|
"%s%s%s", state->path, ": ", msg);
|
||||||
#else
|
#else
|
||||||
strcpy(state->msg, state->path);
|
strlcpy(state->msg, state->path, sizeof(state->msg));
|
||||||
strcat(state->msg, ": ");
|
strcat(state->msg, ": ");
|
||||||
strcat(state->msg, msg);
|
strcat(state->msg, msg);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user