From 35266076e3452590931e58f188815859dff6de3c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 7 Mar 2014 09:46:44 +0100 Subject: [PATCH] dirmngr: Simplify strtok macro. * dirmngr/ldap-url.c (ldap_utf8_strtok): Remove unused r3d arg. (ldap_str2charray): Remove lasts. -- I have no clue why an utf8 version was planned to be used. Do the LDAP folks really assume that eventually non-ascii delimiters might be used? Simplified it to silence the warning about an used helper var. --- dirmngr/ldap-url.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dirmngr/ldap-url.c b/dirmngr/ldap-url.c index e5a7d942e..8308514d6 100644 --- a/dirmngr/ldap-url.c +++ b/dirmngr/ldap-url.c @@ -91,7 +91,7 @@ software is provided `'as is'' without express or implied warranty. */ #define LDAP_MALLOC malloc #define LDAP_REALLOC realloc #define ldap_utf8_strchr strchr -#define ldap_utf8_strtok(n,d,s) strtok (n,d) +#define ldap_utf8_strtok(n,d) strtok (n,d) #define Debug(a,b,c,d,e) void ldap_pvt_hex_unescape( char *s ); @@ -267,7 +267,6 @@ ldap_str2charray( const char *str_in, const char *brkstr ) { char **res; char *str, *s; - char *lasts; int i; /* protect the input string from strtok */ @@ -292,9 +291,9 @@ ldap_str2charray( const char *str_in, const char *brkstr ) i = 0; - for ( s = ldap_utf8_strtok( str, brkstr, &lasts ); + for ( s = ldap_utf8_strtok( str, brkstr); s != NULL; - s = ldap_utf8_strtok( NULL, brkstr, &lasts ) ) + s = ldap_utf8_strtok( NULL, brkstr) ) { res[i] = LDAP_STRDUP( s );