mirror of
https://github.com/tmux/tmux.git
synced 2024-11-13 23:58:51 +00:00
Use strlcpy instead of strncpy, pointed out by deraadt.
This commit is contained in:
parent
353f2a2ad4
commit
6dc6333323
@ -29,13 +29,14 @@
|
|||||||
char *
|
char *
|
||||||
xstrdup(const char *s)
|
xstrdup(const char *s)
|
||||||
{
|
{
|
||||||
void *ptr;
|
char *ptr;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
len = strlen(s) + 1;
|
len = strlen(s) + 1;
|
||||||
ptr = xmalloc(len);
|
ptr = xmalloc(len);
|
||||||
|
|
||||||
return (strncpy(ptr, s, len));
|
strlcpy(ptr, s, len);
|
||||||
|
return (ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
|
Loading…
Reference in New Issue
Block a user