diff options
author | cperciva <cperciva@FreeBSD.org> | 2008-05-23 04:57:28 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2008-05-23 04:57:28 +0000 |
commit | edcc4efbbbba8f8af9957735bf0333cf36665ced (patch) | |
tree | 60aa20edeb5a7a33a676ee103df59cac700696ae /lib/libarchive | |
parent | aa93e85738021af306af981da571d46e20e032db (diff) | |
download | FreeBSD-src-edcc4efbbbba8f8af9957735bf0333cf36665ced.zip FreeBSD-src-edcc4efbbbba8f8af9957735bf0333cf36665ced.tar.gz |
We only use the string "?rwxrwxrwx " once, so inline it rather than
declaring a variable which points to it. Aside from eliminating a
line of code and one level of unnecessary indirection, this eliminates
a false positive in Coverity.
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/archive_entry_strmode.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libarchive/archive_entry_strmode.c b/lib/libarchive/archive_entry_strmode.c index 8022ea0..301f7b6 100644 --- a/lib/libarchive/archive_entry_strmode.c +++ b/lib/libarchive/archive_entry_strmode.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); const char * archive_entry_strmode(struct archive_entry *entry) { - static const char *perms = "?rwxrwxrwx "; static const mode_t permbits[] = { 0400, 0200, 0100, 0040, 0020, 0010, 0004, 0002, 0001 }; char *bp = entry->strmode; @@ -47,7 +46,7 @@ archive_entry_strmode(struct archive_entry *entry) int i; /* Fill in a default string, then selectively override. */ - strcpy(bp, perms); + strcpy(bp, "?rwxrwxrwx "); mode = archive_entry_mode(entry); switch (archive_entry_filetype(entry)) { |