mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(stdstring) word_wrap - use strlcpy instead of strcpy
This commit is contained in:
parent
6126a86259
commit
6894600d41
@ -24,6 +24,7 @@
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <encodings/utf.h>
|
||||
|
||||
@ -234,7 +235,7 @@ void word_wrap(
|
||||
* than line width */
|
||||
if (src_len < line_width)
|
||||
{
|
||||
strcpy(dst, src);
|
||||
strlcpy(dst, src, dst_size);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -256,7 +257,7 @@ void word_wrap(
|
||||
* length is less than line width */
|
||||
if (src_end - src <= line_width)
|
||||
{
|
||||
strcpy(dst, src);
|
||||
strlcpy(dst, src, dst_size);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -283,7 +284,7 @@ void word_wrap(
|
||||
* length is less than line width */
|
||||
if (src_end - src < line_width)
|
||||
{
|
||||
strcpy(dst, src);
|
||||
strlcpy(dst, src, dst_size);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user