From 5cf0b5175bf1f119c3912781cc4d7a2141696397 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 11 Jan 2008 06:39:50 +0000 Subject: [PATCH] ITS#5324 don't use %n --- libraries/libldap/url.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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++] = '['; -- 2.39.5