#ifdef ZEROCONF
-static char UNUSED id[] = "$Id: rendezvous.c,v 1.7 2005/07/31 20:13:08 alex Exp $";
+static char UNUSED id[] = "$Id: rendezvous.c,v 1.8 2006/05/10 21:24:01 alex Exp $";
#include "imp.h"
#include <assert.h>
} /* Rendezvous_Exit */
-GLOBAL bool Rendezvous_Register( char *Name, char *Type, unsigned int Port )
+/**
+ * Register ZeroConf service
+ */
+GLOBAL bool Rendezvous_Register( char *Name, char *Type, UINT16 Port )
{
- /* Register new service */
-
int i;
+ if (Conf_NoZeroConf)
+ return;
+
/* Search free port structure */
for( i = 0; i < MAX_RENDEZVOUS; i++ ) if( ! My_Rendezvous[i].Desc[0] ) break;
if( i >= MAX_RENDEZVOUS )
strcpy( txt, "name conflict!" );
break;
default:
- sprintf( txt, "error code %ld!", (long)ErrCode );
+ snprintf(txt, sizeof txt, "error code %ld!",
+ (long)ErrCode);
}
Log( LOG_INFO, "Can't register \"%s\" with Rendezvous: %s", s->Desc, txt );
strcpy( txt, "name conflict!" );
break;
default:
- sprintf( txt, "error code %ld!", (long)Status );
+ snprintf(txt, sizeof txt, "error code %ld!",
+ (long)Status);
}
Log( LOG_INFO, "Can't register \"%s\" with Rendezvous: %s", s->Desc, txt );