]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix argument to strncpy.
authorNick Mathewson <nickm@torproject.org>
Fri, 12 Nov 2004 21:14:51 +0000 (21:14 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 12 Nov 2004 21:14:51 +0000 (21:14 +0000)
svn:r2824

src/common/util.c

index ced770e57794432b3d390d3184f24ab82677bdb7..d62be23e6124a75593d18399cad92603fa4eabf3 100644 (file)
@@ -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;
 }