[or-cvs] Fix argument to strncpy.

Nick Mathewson nickm at seul.org
Fri Nov 12 21:14:54 UTC 2004


Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv10041/src/common

Modified Files:
	util.c 
Log Message:
Fix argument to strncpy.

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- util.c	12 Nov 2004 20:41:03 -0000	1.179
+++ util.c	12 Nov 2004 21:14:51 -0000	1.180
@@ -171,7 +171,7 @@
    * 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;
 }



More information about the tor-commits mailing list