diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-06 09:43:11 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-06 09:43:11 +0100 |
commit | bde70230e8aeb308c6ec562a33feba32715625de (patch) | |
tree | 2cee7081468c4c8df4e3d722b4245c2a4c07f834 | |
parent | d0f601f066d290d4a2dfb08ab724c6c7f4353649 (diff) | |
download | busybox-w32-bde70230e8aeb308c6ec562a33feba32715625de.tar.gz busybox-w32-bde70230e8aeb308c6ec562a33feba32715625de.tar.bz2 busybox-w32-bde70230e8aeb308c6ec562a33feba32715625de.zip |
libunarchive: trivial code shrink
function old new delta
header_verbose_list 257 237 -20
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libunarchive/header_verbose_list.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/archival/libunarchive/header_verbose_list.c b/archival/libunarchive/header_verbose_list.c index dc3100361..102cd9e11 100644 --- a/archival/libunarchive/header_verbose_list.c +++ b/archival/libunarchive/header_verbose_list.c | |||
@@ -11,18 +11,20 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) | |||
11 | struct tm *mtime = localtime(&(file_header->mtime)); | 11 | struct tm *mtime = localtime(&(file_header->mtime)); |
12 | 12 | ||
13 | #if ENABLE_FEATURE_TAR_UNAME_GNAME | 13 | #if ENABLE_FEATURE_TAR_UNAME_GNAME |
14 | char uid[8]; | 14 | char uid[sizeof(int)*3 + 2]; |
15 | char gid[8]; | 15 | /*char gid[sizeof(int)*3 + 2];*/ |
16 | char *user = file_header->uname; | 16 | char *user; |
17 | char *group = file_header->gname; | 17 | char *group; |
18 | 18 | ||
19 | user = file_header->uname; | ||
19 | if (user == NULL) { | 20 | if (user == NULL) { |
20 | snprintf(uid, sizeof(uid), "%u", (unsigned)file_header->uid); | 21 | sprintf(uid, "%u", (unsigned)file_header->uid); |
21 | user = uid; | 22 | user = uid; |
22 | } | 23 | } |
24 | group = file_header->gname; | ||
23 | if (group == NULL) { | 25 | if (group == NULL) { |
24 | snprintf(gid, sizeof(gid), "%u", (unsigned)file_header->gid); | 26 | /*sprintf(gid, "%u", (unsigned)file_header->gid);*/ |
25 | group = gid; | 27 | group = utoa(file_header->gid); |
26 | } | 28 | } |
27 | printf("%s %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", | 29 | printf("%s %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", |
28 | bb_mode_string(file_header->mode), | 30 | bb_mode_string(file_header->mode), |
@@ -37,10 +39,10 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) | |||
37 | mtime->tm_sec, | 39 | mtime->tm_sec, |
38 | file_header->name); | 40 | file_header->name); |
39 | #else /* !FEATURE_TAR_UNAME_GNAME */ | 41 | #else /* !FEATURE_TAR_UNAME_GNAME */ |
40 | printf("%s %d/%d %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", | 42 | printf("%s %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", |
41 | bb_mode_string(file_header->mode), | 43 | bb_mode_string(file_header->mode), |
42 | file_header->uid, | 44 | (unsigned)file_header->uid, |
43 | file_header->gid, | 45 | (unsigned)file_header->gid, |
44 | file_header->size, | 46 | file_header->size, |
45 | 1900 + mtime->tm_year, | 47 | 1900 + mtime->tm_year, |
46 | 1 + mtime->tm_mon, | 48 | 1 + mtime->tm_mon, |