From: Hallvard Furuseth Date: Thu, 11 Jan 2007 12:06:31 +0000 (+0000) Subject: avoid nonconst* = const* assignment in ldif_open_url(). X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~201 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cb27c610109c818a160339938d8e58c3f0f73c49;p=openldap avoid nonconst* = const* assignment in ldif_open_url(). --- diff --git a/libraries/liblutil/fetch.c b/libraries/liblutil/fetch.c index 5406b88e7e..6535dd20b6 100644 --- a/libraries/liblutil/fetch.c +++ b/libraries/liblutil/fetch.c @@ -43,23 +43,23 @@ ldif_open_url( LDAP_CONST char *urlstr ) { FILE *url; - char *p = NULL; #ifdef HAVE_FETCH url = fetchGetURL( (char*) urlstr, "" ); #else if( strncasecmp( "file:", urlstr, sizeof("file:")-1 ) == 0 ) { - p = urlstr + sizeof("file:")-1; + char *p; + urlstr += sizeof("file:")-1; /* we don't check for LDAP_DIRSEP since URLs should contain '/' */ - if ( p[0] == '/' && p[1] == '/' ) { - p += 2; + if ( urlstr[0] == '/' && urlstr[1] == '/' ) { + urlstr += 2; /* path must be absolute if authority is present */ - if ( p[0] != '/' ) + if ( urlstr[0] != '/' ) return NULL; } - p = ber_strdup( p ); + p = ber_strdup( urlstr ); ldap_pvt_hex_unescape( p ); url = fopen( p, "rb" );