mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Fix argument to strncpy.
svn:r2824
This commit is contained in:
parent
a8f9ba91db
commit
a3788d5c9d
@ -171,7 +171,7 @@ char *tor_strndup(const char *s, size_t n) {
|
||||
* this function gets called a whole lot, and platform strncpy is
|
||||
* much faster than strlcpy when strlen(s) is much longer than n.
|
||||
*/
|
||||
strncpy(dup, s, n+1);
|
||||
strncpy(dup, s, n);
|
||||
dup[n]='\0';
|
||||
return dup;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user