]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/reject.c
SLAP_NVALUES: prepare for new schema routines
[openldap] / servers / slurpd / reject.c
index 2596ab57bc6b49f2b4e410f3c891f60957f28449..0b4d5ee12e04f1de9d7c49cebc909464f0cc6baf 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*
 #include "slurp.h"
 #include "globals.h"
 
+#ifdef _WIN32
+#define        PORTSEP ","
+#else
+#define        PORTSEP ":"
+#endif
+
 /*
  * Write a replication record to a reject file.  The reject file has the
  * same name as the replica's private copy of the file but with ".rej"
@@ -57,8 +63,8 @@ write_reject(
     int                rc;
 
     ldap_pvt_thread_mutex_lock( &sglob->rej_mutex );
-    sprintf( rejfile, "%s" LDAP_DIRSEP "%s:%d.rej", sglob->slurpd_rdir,
-           ri->ri_hostname, ri->ri_port );
+    snprintf( rejfile, sizeof rejfile, "%s" LDAP_DIRSEP "%s" PORTSEP "%d.rej",
+               sglob->slurpd_rdir, ri->ri_hostname, ri->ri_port );
 
     if ( access( rejfile, F_OK ) < 0 ) {
        /* Doesn't exist - try to create */