mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +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 <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <compat/strl.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
#include <encodings/utf.h>
|
#include <encodings/utf.h>
|
||||||
|
|
||||||
@ -234,7 +235,7 @@ void word_wrap(
|
|||||||
* than line width */
|
* than line width */
|
||||||
if (src_len < line_width)
|
if (src_len < line_width)
|
||||||
{
|
{
|
||||||
strcpy(dst, src);
|
strlcpy(dst, src, dst_size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,7 +257,7 @@ void word_wrap(
|
|||||||
* length is less than line width */
|
* length is less than line width */
|
||||||
if (src_end - src <= line_width)
|
if (src_end - src <= line_width)
|
||||||
{
|
{
|
||||||
strcpy(dst, src);
|
strlcpy(dst, src, dst_size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -283,7 +284,7 @@ void word_wrap(
|
|||||||
* length is less than line width */
|
* length is less than line width */
|
||||||
if (src_end - src < line_width)
|
if (src_end - src < line_width)
|
||||||
{
|
{
|
||||||
strcpy(dst, src);
|
strlcpy(dst, src, dst_size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user