From: Colin Percival Date: Tue, 16 Aug 2011 18:04:19 +0000 (-0400) Subject: Remove unnecessary call to strlen; we already know how long this string is. X-Git-Tag: v3.0.0a~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfd14dc76f757c389bbb881197315b1041fd84d6;p=thirdparty%2Flibarchive.git Remove unnecessary call to strlen; we already know how long this string is. Via: Tarsnap SVN-Revision: 3628 --- diff --git a/libarchive_fe/matching.c b/libarchive_fe/matching.c index b2aba0227..4ba608222 100644 --- a/libarchive_fe/matching.c +++ b/libarchive_fe/matching.c @@ -140,7 +140,7 @@ add_pattern(struct match **list, const char *pattern) strcpy(match->pattern, pattern); /* Both "foo/" and "foo" should match "foo/bar". */ if (len && match->pattern[len - 1] == '/') - match->pattern[strlen(match->pattern)-1] = '\0'; + match->pattern[len - 1] = '\0'; match->next = *list; *list = match; match->matches = 0;