/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2010 The OpenLDAP Foundation.
+ * Copyright 1998-2012 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/* figure out how big the string is */
size = 1; /* nul-term */
for (ludp = ludlist; ludp != NULL; ludp = ludp->lud_next) {
+ if ( ludp->lud_host == NULL ) continue;
size += strlen(ludp->lud_host) + 1; /* host and space */
if (strchr(ludp->lud_host, ':')) /* will add [ ] below */
size += 2;
p = s;
for (ludp = ludlist; ludp != NULL; ludp = ludp->lud_next) {
+ if ( ludp->lud_host == NULL ) continue;
if (strchr(ludp->lud_host, ':')) {
p += sprintf(p, "[%s]", ludp->lud_host);
} else {
}
if (p != s)
p--; /* nuke that extra space */
- *p = 0;
+ *p = '\0';
return s;
}