X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslurpd%2Freject.c;h=0b4d5ee12e04f1de9d7c49cebc909464f0cc6baf;hb=782b481a9a0415fb652590282b95bb11701a00e4;hp=2596ab57bc6b49f2b4e410f3c891f60957f28449;hpb=c673b651e8f3643e7382e58fd596f88e5115f889;p=openldap diff --git a/servers/slurpd/reject.c b/servers/slurpd/reject.c index 2596ab57bc..0b4d5ee12e 100644 --- a/servers/slurpd/reject.c +++ b/servers/slurpd/reject.c @@ -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 */ /* @@ -36,6 +36,12 @@ #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 */