]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Remove unnecessary call to strlen; we already know how long this string is.
authorColin Percival <cperciva@daemonology.net>
Tue, 16 Aug 2011 18:04:19 +0000 (14:04 -0400)
committerColin Percival <cperciva@daemonology.net>
Tue, 16 Aug 2011 18:04:19 +0000 (14:04 -0400)
Via: Tarsnap

SVN-Revision: 3628

libarchive_fe/matching.c

index b2aba0227eaf9015b6683aebb3f474bc3409a20b..4ba608222f3f979a3d0f3f9802ad4b905d6d9960 100644 (file)
@@ -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;