]> git.sur5r.net Git - openldap/commitdiff
ITS#5324 don't use %n
authorHoward Chu <hyc@openldap.org>
Fri, 11 Jan 2008 06:39:50 +0000 (06:39 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 11 Jan 2008 06:39:50 +0000 (06:39 +0000)
libraries/libldap/url.c

index 4295895a5e6d00597712ec391685d017418c93d8..b614965dd05031de8801c1edbff271ea77923e91 100644 (file)
@@ -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++] = '[';