From: Tobias Brunner Date: Wed, 27 Mar 2013 15:15:10 +0000 (+0100) Subject: Remove dead code in token enumerator X-Git-Tag: 5.1.0dr1~129^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e55270aeabc41a78240a691707103c6f9cde56b;p=thirdparty%2Fstrongswan.git Remove dead code in token enumerator Since we always search for the nearest separator (and strip them from the front of the next token) there can't be any separators left at the end of a token. --- diff --git a/src/libstrongswan/collections/enumerator.c b/src/libstrongswan/collections/enumerator.c index f80cdabd2d..8049ac016e 100644 --- a/src/libstrongswan/collections/enumerator.c +++ b/src/libstrongswan/collections/enumerator.c @@ -264,7 +264,7 @@ static bool enumerate_token_enum(token_enum_t *this, char **token) } } - /* trim trailing characters/separators */ + /* trim trailing characters */ pos--; while (pos >= *token) { @@ -278,17 +278,7 @@ static bool enumerate_token_enum(token_enum_t *this, char **token) } trim++; } - sep = this->sep; - while (*sep) - { - if (*sep == *pos) - { - *(pos--) = '\0'; - break; - } - sep++; - } - if (!*trim && !*sep) + if (!*trim) { break; }