Browse Source

Fix argument to strncpy.

svn:r2824
Nick Mathewson 21 years ago
parent
commit
a3788d5c9d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/common/util.c

+ 1 - 1
src/common/util.c

@@ -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;
 }