From: Howard Chu Date: Fri, 11 Jan 2008 06:39:50 +0000 (+0000) Subject: ITS#5324 don't use %n X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~219 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5cf0b5175bf1f119c3912781cc4d7a2141696397;p=openldap ITS#5324 don't use %n --- diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 4295895a5e..b614965dd0 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -642,14 +642,16 @@ desc2str( LDAPURLDesc *u, char *s, int len ) } if ( u->lud_port ) { - len -= sprintf( s, "%s://%s%s%s:%d%n", u->lud_scheme, + sofar = sprintf( s, "%s://%s%s%s:%d", u->lud_scheme, is_v6 ? "[" : "", u->lud_host ? u->lud_host : "", is_v6 ? "]" : "", - u->lud_port, &sofar ); + u->lud_port ); + len -= sofar; } else { - len -= sprintf( s, "%s://%n", u->lud_scheme, &sofar ); + sofar = sprintf( s, "%s://", u->lud_scheme ); + len -= sofar; if ( u->lud_host && u->lud_host[0] ) { if ( is_v6 ) { s[sofar++] = '[';