]> arthur.barton.de Git - netatalk.git/commitdiff
Replace snprintf() with a call to strncpy, and use tempnam() to generate
authorjmarcus <jmarcus>
Thu, 22 Aug 2002 06:59:07 +0000 (06:59 +0000)
committerjmarcus <jmarcus>
Thu, 22 Aug 2002 06:59:07 +0000 (06:59 +0000)
the name of the debugging file.

etc/afpd/afp_dsi.c

index 97f3d312a6478936e157cc334350f8f0f0f99d5f..f4a1235bc5e50135c6fa876beb5ba7f67bfae1e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_dsi.c,v 1.21 2002-05-03 22:51:33 jmarcus Exp $
+ * $Id: afp_dsi.c,v 1.22 2002-08-22 06:59:07 jmarcus Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -143,7 +143,7 @@ void afp_set_debug (int sig)
 {
     char       fname[MAXPATHLEN];
 
-    snprintf(fname, MAXPATHLEN-1, "%safpd-debug-%d", P_tmpdir, getpid());
+    strncpy(fname, tempnam(P_tmpdir, "afpd-debug"), MAXPATHLEN-1);
     freopen(fname, "w", stdout);
     child.obj->options.flags |= OPTION_DEBUG;